Delete a directory in Linux

The answer is simple. Use the rmdir command followed by the name of the directory you want to delete.

Example. Suppose we have a directory called mydirectory, which is inside a directory called html. First we would have to go inside the html directory, with the cd command, which is used to change directories. Then we would do the command:

rmdir mydirectory

This command does not ask for confirmation of whether you want to delete the directory. But it doesn’t allow you to delete it if the directory has some content inside, so first we will have to delete what may be in mydirectory.

See also  Virtual directories in IIS
Loading Facebook Comments ...
Loading Disqus Comments ...