next up previous contents
Next: Crossreferences to Files: Up: Files & Directories Previous: Copying Files

Removing Directories and their Contents

To remove a directory and its contents we could erase every individual file in the directory and its subdirectories, then all the subdirectories and finally the directory itself. As this is very cumbersome the rm command can be forced to recursively delete directories and their contents, like the cp command can copy directories recursively:

$rm -R safedata
$ls -F
a          b          c          data/      junk/      programs/

Mark O. Stitson
Wed Sep 25 10:45:32 BST 1996