how to use rmdir command with its examples

The rmdir command is used to remove empty directories from the file system. Which stands for “remove directory”

  • About rmdir: To remove empty directories
  • Comes From : coreutils-8.4
  • Configuration Files:
  • Path: /bin/rmdir

Examples:

1. To remove an empty directory

$ rmdir /mike

 2. To ignore each failure that is solely because a director

$ rmdir –ignore-fail-on-non-empty

 3. To remove DIRECTORY and its ancestors

$ rmdir -p /mike/mydir
$ rmdir –parents /mike/mydir

 4. To output a diagnostic for every directory processed

$ rmdir -v /mike/mydir
$ rmdir –verbose /mike/mydir 

5. To get the help

$ rmdir –help

 6. To get the version

$ rmdir –version 

Leave a Reply

Your email address will not be published. Required fields are marked *