Quick Answer: How to Delete in Linux?
Contents How to Remove Files and Directories Using Linux Command Line to Delete a Single File Use, the Rm Command Followed by the File Name: to Delete Multiple...
Contents
How to Remove Files and Directories Using Linux Command Line
- To delete a single file use, the rm command followed by the file name:
- To delete multiple files at once use the rm command followed by the file names separated by space.
- Use the -i option to confirm each file before deleting it:
How do I delete multiple files in Linux?
In order to remove one single file using the rm command, run the following command:
- rm filename. Using the above command, it will prompt you to make a choice of going ahead or back out.
- rm -rf directory.
- rm file1.jpg file2.jpg file3.jpg file4.jpg.
- rm *
- rm *.jpg.
- rm *specificword*
Must Read
How do I delete a file in Terminal?
Open Terminal, type “rm” (no quotes, but there should be a space after it). Drag & drop the file you want to remove onto the Terminal window, and its path will be added at the end of the command, then hit Return. Your file will be removed beyond recovery.