3.3.6 Deleting files and directories


Next: 3.3.7 Looking at files Up: 3.3 First Steps into Previous: 3.3.5 Moving files

      You now have an ugly rhyme developing with the use of the ls command. To delete a file, use the rm command. (« rm » stands for « remove »).

/home/larry/foo# rm bells sells
/home/larry/foo# ls -F shells

/home/larry/foo#

We’re left with nothing but shells, but we won’t complain. Note that rm by default won’t prompt you before deleting a file—so be careful.

      A related command to rm is rmdir. This command deletes a directory, but only if the directory is empty. If the directory contains any files or subdirectories, rmdir will complain.


Next: 3.3.7 Looking at files Up: 3.3 First Steps into Previous: 3.3.5 Moving files

Matt Welsh
mdw@sunsite.unc.edu

READ  Configuring Sendmail in RedHat 6.2 LG #58