Linux: The 'mkdir' command

'mkdir' is the command for making directories. 'mkdir' may be familiar to MS-DOS users out there. As you have noticed, the people who wrote these programs tried to give them names that described what they do more or less, not as long as 'makemeadirectoryplease' and not too cryptic like 'xr77b'.


Using the 'mkdir' command
To create the directory 'my_friends' that we talked about in the last lesson, you would type:

mkdir my_friends

There are no whistles or buzzers. If you'd like some sort of acknowledgment, you could type
mkdir --verbose my_friends

and it will tell you that you created the directory.
If you type ls -l You'll see it there along with information about it.
Now you know how to use 'mkdir'. You can even use it to create a directory called 'my_enemies' if you're into that sort of thing.


The 'rmdir' command
'rmdir' is the opposite of 'mkdir'- it gets rid of directories. It should be pointed out that in order to use it, the directory has to be empty. If you copied or moved anything to 'my_friends' and you typed
rmdir my_friends/

Linux would politely tell you that you can't do that.

So, you have to use your 'rm' command on the files first to remove them or use 'mv' to get them into another directory. Then you're free to use 'rmdir'
So, next we'll deal with the 'rm' command.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Adding a range/block of ips

As an example to add a /24 253 ips to a linux server follow these setups. We'll use...

How can I check my hard disk usage in Linux?

Once you are connected to the server via SSH, run the following command:# df -hThis will output...

Test If Linux Server SCSI / SATA Hard Disk Going Bad

One of our regular sends us a question: How can I test if my hard disk is going bad? I see few...

How to Find Out Hard Disk Specs / Details on Linux

Linux comes with various commands to find out information about your hard drive. I recommend...

Monitoring Hard Drive Health on Linux with smartmontools

S.M.A.R.T. is a system in modern hard drives designed to report conditions that may indicate...

Powered by WHMCompleteSolution