[Ilugc] One Day One GNU/Linux Command (RM)

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Fri Jun 20 11:39:00 2008

One Day One GNU/Linux Command
=============================

rm -- ReMove files or directories.

Summary :

rm removes each specified file. By default, it does not remove
directories.

Examples :

$ rm myfile -- Remove the myfile from current dir.

$ rm f1 f2 f3 -- Remove f1,f2 and f3.

$ rm f? -- Remove all files, whose name start with f and 
           followed by single char.

$ rm f* -- Remove all files, whose name starting with f.

$ rm -i myfile -- Ask for interactive conformation (Y/N).

$ rm -f myfile -- Force, Ignore nonexistent files.

$ rm -d mydir -- Remove the directory.

$ rm -r mydir -- Remove the contents of dirs recursively.

$ rm -v myfile -- Explain what is being done.

$ rm "my file" -- Removing a file, whose name has space.

$ rm -- -h -- Remove a file, whose name starting with '-'.

Note: '--' === End of command line options.

Read : man rm

HTH :)
-- 
Bharathi S

Other related posts: