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 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:

  1. rm filename. Using the above command, it will prompt you to make a choice of going ahead or back out.
  2. rm -rf directory.
  3. rm file1.jpg file2.jpg file3.jpg file4.jpg.
  4. rm *
  5. rm *.jpg.
  6. rm *specificword*

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.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest