rmdir

The rmdir command removes one or more directories. The directory must be empty in order to be removed or you must use the -f option. You can also specify more than one directory to be removed. Going back to our earlier discussion on permissions, you must have both write and execute permissions on the parent of a directory to be removed in order to remove it.

As with some of the other commands we have covered, you can use the -i option, which asks you to confirm each directory as it is removed. This means that if you are asked whether you really wish to remove a directory and you respond n, then it is not removed. If you respond y, it is removed.

The order in which you specify that directories are to be removed is significant. If you want ...

Get HP-UX 11i System Administration Handbook and Toolkit, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.