Home » Linux rm | Linux delete file

Linux rm | Linux delete file

by Online Tutorials Library

Linux rm | Linux Delete File

The ‘rm’ means remove. This command is used to remove a file. The command line doesn’t have a recycle bin or trash unlike other GUI’s to recover the files. Hence, be very much careful while using this command. Once you have deleted a file, it is removed permanently.

Syntax:

Example:

rm file

In above snapshot, we have removed file myfile1 permanently with the help of ‘rm’ command.


rm Options

Option Description
rm *extension Used to delete files having same extension.
rm -r or R To delete a directory recursively.
rm -i Remove a file interactively.
rm -rf Remove a directory forcefully.
Next TopicLinux cp command

You may also like