next up previous contents
Next: Define Current (working) Directory Up: Basic Directory Commands Previous: Create   Contents

Delete

To delete a subdirectory use rmdir (remove directory) e.g.:-

rmdir work
removes work directory below the current directory. The remove will fail if the directory is not empty. An alternative way to delete a directory is to use the delete command rm with the -r option e.g.:-
rm -r d1
This deletes d1 together with its contents (including the entire subtree of directories it contains). This also is very powerful and must be used with EXTREME caution, it is better for the beginner not to use this command at all! A classic mistake with rm -r is to type:-
rm -r .*
Remember that . is the current directory and .. is the current parent directory, so this commands deletes the entire contents of both!!!



P.D. Gronbech (IT Staff) 2015-10-02