English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux rmdir Command

Linux Command Manual

The Linux rmdir command (full English name: remove directory) is used to delete empty directories.

Syntax

rmdir [-p] dirName

Parameters:

  • -p is used to delete the subdirectory as well if it becomes an empty directory after the deletion.
  • Online Examples

    Delete the subdirectory named AAA under the working directory:

    rmdir AAA

    Delete the subdirectory named Test in the BBB directory under the working directory. If the BBB directory becomes empty after Test is deleted, BBB will also be deleted.

    rmdir -p BBB/Test

    Linux Command Manual