Saturday, July 26, 2014

rmdir in linux/unix

  1. First make sure you are in your home directory. Then try to remove the newdir directory. What happens?
    
         cd ~
         rmdir newdir
         
  2. Recursively list the contents of newdir. Notice that its subdirectories are all empty. Remove all of the empty subdirectories within newdir and then list newdir again to confirm that they were removed:
    
         ls -R newdir
         rmdir newdir/*
         ls -R newdir
         
  3. Finally, remove the empty newdir directory:
    
         rmdir newdir
         

Reactions:

0 comments:

Post a Comment