{
    "mode": "info",
    "parameter": "rmdir",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/rmdir/json",
    "generated": "2026-10-13T06:45:46Z",
    "sections": {
        "File: coreutils.info,  Node: rmdir invocation,  Next: unlink invocation,  Prev: readlink invocation,  Up: Special file types": {
            "content": "",
            "subsections": [
                {
                    "name": "12.7 'rmdir': Remove empty directories",
                    "content": "'rmdir' removes empty directories.  Synopsis:\n\nrmdir [OPTION]... DIRECTORY...\n\nIf any DIRECTORY argument does not refer to an existing empty\ndirectory, it is an error.\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'--ignore-fail-on-non-empty'\nIgnore each failure to remove a directory that is non-empty.\n\n'-p'\n'--parents'\nRemove DIRECTORY, then try to remove each component of DIRECTORY.\nSo, for example, 'rmdir -p a/b/c' is similar to 'rmdir a/b/c a/b\na'.  As such, it fails if any of those directories turns out not to\nbe empty.  Use the '--ignore-fail-on-non-empty' option to make it\nso such a failure does not evoke a diagnostic and does not cause\n'rmdir' to exit unsuccessfully.\n\n'-v'\n'--verbose'\nGive a diagnostic for each successful removal.  DIRECTORY is\nremoved.\n\n*Note rm invocation::, for how to remove non-empty directories\nrecursively.\n\nTo remove all empty directories under DIRNAME, including directories\nthat become empty because other directories are removed, you can use\neither of the following commands:\n\n# This uses GNU extensions.\nfind DIRNAME -type d -empty -delete\n\n# This runs on any POSIX platform.\nfind DIRNAME -depth -type d -exec rmdir {} +\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}