Linux rm command

If you wish to remove a file or folder within your Linux system you can use the rm command. In this article, we’ll show the basic usage of the Linux rm Command.

Delete a file using Linux rm command

rm myFile.txt

Delete recursively using Linux rm -r

When you wish to delete all files and directories you can use rm -r

rm -r /directory/

Delete a file without asking for permission

rm -f myFile.txt

Delete a file using WildCard

This will delete all .txt files

rm -f *.txt

Delete all files and the directory

rm -rf /path/to/directory

Delete file and display information

rm -v myFile.txt

Delete file while being prompted for it

rm -i myFile.txt
  • 0 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

Linux top command

If you wish to monitor the performance of your VPS or Dedicated server and track processes, RAM...

Linux ping command

If you wish to test your connection to a server from your Linux system you can use the Linux ping...

Linux file command

The file command is used to check a file’s type and contents in Linux environment. It is most...

Linux export command

When you’re managing your shell’s variables and you wish to save them to your environment you can...