• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • All
  • About
Linux-Ubuntu | rmdir -- remove directories
  1. Notes
  2. Examples

  1. Notes
    rmdir directory ...

    The rmdir command removes the provided list of directories (they are removed in the order given).

    A directory must be empty to be removed by the rmdir command.

    You must enter all sub-directories before their parent directory so they all could be removed.
  2. Examples
    • Removing a directory:
      $ rmdir folder1
      The folder must be empty, otherwise, you will get this error: "rmdir: folder: Directory not empty".

    • Removing a directory and its sub-directories:
      $ rmdir folder/folder1 folder/folder2 folder
© 2025  mtitek