Linux delete file

September 27, 2021 Off By Tobias

Linux files deletion via the console:

rm deleteme.txt

rm= remove. If multiple files are to be deleted, they are listed with a space:

rm deleteme.txt deleteme2.txt

Linux folder deletion via the console:

rm -r foldername
  • To delete a single file, use rm FileName.
  • To remove multiple files use rm FileName1 FileName2 FileName3
  • For folders use rm -r OrderName
  • You can also insert placeholders. For example, rm *.txt can delete all files with the extension .txt in the current directory.
  • With man rm you can call the help page for rm in the terminal.