Developer's Daily Unix by Example
  main | java | perl | unix | DevDirectory
   
Main
Unix
Education
Unix by Example
   

 

Command rm
Description The "rm" command is used to remove files and directories. (Warning - be very careful when removing files and directories!)
Examples rm Chapter1.bad

This command deletes the file named "Chapter1.bad" (assuming you have permission to delete this file).

rm Chapter1 Chapter2 Chapter3

This command deletes the files named "Chapter1", "Chapter2", and "Chapter3".

rm -i Chapter1 Chapter2 Chapter3

This command prompts you before deleting any of the three files specified. The -i option stands for inquire. You must answer y (for yes) for each file you really want to delete. This can be a safer way to delete files.

rm *.html

This command deletes all files in the current directory whose filename ends with the characters ".html".

rm index*

This command deletes all files in the current directory whose filename begins with the characters "index".

rm -r new-novel

This command deletes the directory named "new-novel". This directory, and all of its' contents, are erased from the disk, including any sub-directories and files.

 


What's related

copyright 1998-2007, devdaily.com, all rights reserved.
devdaily.com, an alvin j. alexander production.