How to delete files and folders in Linux/Unix

How to delete files and folders in Linux/Unix

Basically in linux rm command is using for delete files and directory

To remove a file named file.txt, use the following command.

rm file.txt

 

Remove multiple files file.txt,file2.txt,file3.txt use the following command.

rm file.txt file2.txt file3.txt

Linux offer the following commands to delete/remove files/folders:

Remove files that pop up “remove regular file”.If you need to remove the var directory with files that need file permissions to delete.Use the code below

rm -r --interactive=never /var/

or

rm -rf /var/
Updated: July 2, 2018 — 7:34 am

Leave a Reply

Your email address will not be published. Required fields are marked *