CentOS Debian Mint Scripting Ubuntu

rm command in Linux

rm command in Linux


rm stands for remove. It is a command that allows you to remove files, folders, symlinks from the system. Deleted files and folders will not be moved to the recycle bin, but the rm command will delete them immediately. You must be careful before using this command.

And we will show you how to check the manual by using the rm command in Linux as you go through it below.

The syntax of rm command

$ rm [option]... file...

For example, I have 2 files: a.txt and b.txt

Now, I will remove file a.txt:

$ rm a.txt


As you can see. the a.txt file has been lost.

Or you can remove multiple files:

$ rm b.txt datefile.txt



1. -i: must confirm before deleting

For example, I will remove file c.txt:

$ rm -i c.txt


You must press y to confirm.

2. -r: remove a directory

For example, I will remove directory snort3:

$ rm -r snort3


3. –version: check your version

$ rm --version



Hope you understood the tutorial on how to use the rm command in Linux.

Thanks for reading!

Similar Posts