1 00:00:00,360 --> 00:00:08,680 Hello in this video we are going to learn how to create new directories and how to delete EMPTY directories. 2 00:00:08,680 --> 00:00:18,030 So right now if I go to my desktop see the desktop and then I do an ls i will find nothing here because 3 00:00:18,060 --> 00:00:20,630 as you can see my desktop is empty. 4 00:00:20,920 --> 00:00:21,460 OK. 5 00:00:21,600 --> 00:00:25,730 What if I want to create a new directory on my desktop. 6 00:00:25,770 --> 00:00:26,770 That's pretty simple. 7 00:00:26,760 --> 00:00:31,190 All you need to do is just type MKC are so empty. 8 00:00:31,230 --> 00:00:37,490 Or is a command to create new directories and then you specify your directory name here. 9 00:00:37,500 --> 00:00:42,770 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 10 00:00:42,840 --> 00:00:44,220 or space A. 11 00:00:44,520 --> 00:00:47,600 And this will create a directory. 12 00:00:47,860 --> 00:00:57,690 So Kitty or stands for make directory and as you can see the command name itself pretty much explains 13 00:00:57,690 --> 00:00:58,970 what it does. 14 00:00:59,220 --> 00:01:03,210 That's why the Linux commands are pretty easy to remember. 15 00:01:04,130 --> 00:01:07,440 OK so what if you want to create more than one directory. 16 00:01:07,440 --> 00:01:09,620 So that's also pretty simple. 17 00:01:09,630 --> 00:01:13,840 All you need to do is just separate the directory names by a space. 18 00:01:13,890 --> 00:01:20,540 So if you want for example to create directory name one rectory name to directory name 3 and so on. 19 00:01:21,030 --> 00:01:27,560 So I would create three more directories B C and D as you can see. 20 00:01:28,050 --> 00:01:33,800 And if I do an ls l i will find my four directories here a b c and d. 21 00:01:35,510 --> 00:01:36,680 Perfect and. 22 00:01:36,720 --> 00:01:39,390 OK so that's for make directory. 23 00:01:39,440 --> 00:01:46,610 Now what if you want to remove directory for example as you can see directory old all these directories 24 00:01:46,610 --> 00:01:48,410 you know are empty of course. 25 00:01:48,410 --> 00:01:50,770 So what if you want to remove directory. 26 00:01:50,960 --> 00:01:53,830 That's pretty simple to just say our MDI or. 27 00:01:53,840 --> 00:01:56,430 And then you specify a directory name here. 28 00:01:56,600 --> 00:02:02,310 So I want to delete a that's left as you can see now is gone. 29 00:02:02,330 --> 00:02:06,940 So if I do an l s l as you can see it does not appear here. 30 00:02:07,130 --> 00:02:08,600 It appeared before. 31 00:02:09,170 --> 00:02:14,680 And if you want to delete all those directories at once you just do the same thing. 32 00:02:14,680 --> 00:02:18,690 So I want to delete b c and d and. 33 00:02:18,910 --> 00:02:19,460 Yeah. 34 00:02:19,730 --> 00:02:21,120 And the argon. 35 00:02:21,170 --> 00:02:21,680 Cool. 36 00:02:21,950 --> 00:02:28,310 So let's make another directory here and I'll call it directory one on my desktop and I want to create 37 00:02:28,370 --> 00:02:33,500 a file inside of directory one with my touch command. 38 00:02:33,890 --> 00:02:37,800 I'll call it file 1 or text 1. 39 00:02:38,390 --> 00:02:45,690 Ok so if I go to my if I do an ls directory one I can find text one here as you can see. 40 00:02:45,990 --> 00:02:51,120 So right now my directory of one is not empty. 41 00:02:51,120 --> 00:03:00,180 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. 42 00:03:00,180 --> 00:03:02,810 Remove a directory as you may have guessed. 43 00:03:03,400 --> 00:03:11,850 OK so if I tried to execute the command it will tell me failed to remove directory 1 or dial one because 44 00:03:11,850 --> 00:03:12,920 it was not empty. 45 00:03:12,930 --> 00:03:13,860 So. 46 00:03:14,490 --> 00:03:22,220 So that means that the command or MDI are will only remove a directory if it is empty. 47 00:03:22,380 --> 00:03:26,760 If it is not empty then it will not remove it. 48 00:03:26,760 --> 00:03:33,130 So let's make another directory and call it directory to for example and maybe another one and call 49 00:03:33,180 --> 00:03:34,300 directory 3. 50 00:03:34,590 --> 00:03:35,140 OK. 51 00:03:35,370 --> 00:03:46,350 Right now on my desktop I have three directories directory one directory to directory three but directory 52 00:03:46,350 --> 00:03:52,020 one is the only non empty directory and and the other two are empty of course. 53 00:03:52,020 --> 00:03:53,050 Right. 54 00:03:53,160 --> 00:03:59,060 So what will happen if I said R and B are directory one directory to the directory 3. 55 00:03:59,190 --> 00:04:01,270 So what would you expect. 56 00:04:01,470 --> 00:04:09,630 This will simply remove all the empty directories and it will it will not remove any in an empty directory 57 00:04:10,180 --> 00:04:10,680 so. 58 00:04:10,770 --> 00:04:13,150 So here we have three directories right. 59 00:04:13,150 --> 00:04:14,990 Two is two of them are empty. 60 00:04:15,000 --> 00:04:16,420 One of them is not empty. 61 00:04:16,560 --> 00:04:23,400 So if I execute this command it will only delete the retrieve 2 and 3 because they are empty but it 62 00:04:23,400 --> 00:04:25,260 will not remove directly you. 63 00:04:25,260 --> 00:04:26,100 Let's see. 64 00:04:26,300 --> 00:04:28,090 So I just hit enter. 65 00:04:28,700 --> 00:04:36,570 And as you can see it removed directly to directory 3 but it did not remove directory one because it 66 00:04:36,570 --> 00:04:38,180 was not empty. 67 00:04:38,850 --> 00:04:39,540 So yeah. 68 00:04:39,810 --> 00:04:41,430 So that's it for this video. 69 00:04:41,460 --> 00:04:51,870 And in the next video or so I will show you how to remove non empty directories Until then Ciao.