Debian Linux Delete Directory Command

in Categories last updated January 19, 2011

I am new to Debian Linux and bash shell command line. How do I delete or remove a directory using bash prompt?

You need to use the rmdir command to remove the DIRECTORY(ies), if they are empty. Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command to remove a directory called foo:
$ rmdir foo
To remove all directories and subdirectories use the rm command as follows:
$ rmdir bar
If you need assistance with Debian Linux rmdir command-line options, turn to the man page first. It will give you detailed information, parameters and switches for rmdir command:
$ man rmdir

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 0 comments/add one below):