Examples of using the rm command

1. To remove a file from your current directory:

   $ rm prog.c

This removes the file prog.c from the current directory

2. To remove a file which you don't have write permission for:

   $ rm tmp/intro.txt
   rm: override protection 444 for intro.txt?y
   $

This removes the file intro.txt from the subdirectory tmp. Because you don't have write permission for this file you are asked to confirm that you want to remove it. Entering a "y" removes the file, any other response leaves the file alone.

3. To remove a file using a pathname:

   $ rm book/chapt1/sect1

This removes the file sect1 from the subdirectory book/chapt1

3. To remove files using


Top document