OneCompiler

rm Linux Command Cheatsheet

3781

rm (remove) Linux Command is used to remove objects such as files, directories, symbolic links, device nodes, pipes and sockets from the file system.

Syntax

rm [Option(s)] [File(s) to remove]

Examples

Removing a single file

rm file1.txt #=> removes file1.txt

Removing multiple files

rm file1.txt file2.txt #=> removes file1.txt and file2.txt

Interactive deletion

rm -i readme.txt
remove readme.txt? Y 

Force deletion (Removes even if the file is write protected)

rm readme.txt

Delete recusively

rm -r *