Hello in this video we are going to learn how to create new directories and how to delete EMPTY directories.
So right now if I go to my desktop see the desktop and then I do an ls i will find nothing here because
as you can see my desktop is empty.
OK.
What if I want to create a new directory on my desktop.
That's pretty simple.
All you need to do is just type MKC are so empty.
Or is a command to create new directories and then you specify your directory name here.
So if I want to create a directory and I want to call it a all you need to do is just type and Cadia
or space A.
And this will create a directory.
So Kitty or stands for make directory and as you can see the command name itself pretty much explains
what it does.
That's why the Linux commands are pretty easy to remember.
OK so what if you want to create more than one directory.
So that's also pretty simple.
All you need to do is just separate the directory names by a space.
So if you want for example to create directory name one rectory name to directory name 3 and so on.
So I would create three more directories B C and D as you can see.
And if I do an ls l i will find my four directories here a b c and d.
Perfect and.
OK so that's for make directory.
Now what if you want to remove directory for example as you can see directory old all these directories
you know are empty of course.
So what if you want to remove directory.
That's pretty simple to just say our MDI or.
And then you specify a directory name here.
So I want to delete a that's left as you can see now is gone.
So if I do an l s l as you can see it does not appear here.
It appeared before.
And if you want to delete all those directories at once you just do the same thing.
So I want to delete b c and d and.
Yeah.
And the argon.
Cool.
So let's make another directory here and I'll call it directory one on my desktop and I want to create
a file inside of directory one with my touch command.
I'll call it file 1 or text 1.
Ok so if I go to my if I do an ls directory one I can find text one here as you can see.
So right now my directory of one is not empty.
So if I type if I if I try to remove it with my R and D r command so R M D R stands for.
Remove a directory as you may have guessed.
OK so if I tried to execute the command it will tell me failed to remove directory 1 or dial one because
it was not empty.
So.
So that means that the command or MDI are will only remove a directory if it is empty.
If it is not empty then it will not remove it.
So let's make another directory and call it directory to for example and maybe another one and call
directory 3.
OK.
Right now on my desktop I have three directories directory one directory to directory three but directory
one is the only non empty directory and and the other two are empty of course.
Right.
So what will happen if I said R and B are directory one directory to the directory 3.
So what would you expect.
This will simply remove all the empty directories and it will it will not remove any in an empty directory
so.
So here we have three directories right.
Two is two of them are empty.
One of them is not empty.
So if I execute this command it will only delete the retrieve 2 and 3 because they are empty but it
will not remove directly you.
Let's see.
So I just hit enter.
And as you can see it removed directly to directory 3 but it did not remove directory one because it
was not empty.
So yeah.
So that's it for this video.
And in the next video or so I will show you how to remove non empty directories Until then Ciao.