1 00:00:00,590 --> 00:00:01,200 Welcome back. 2 00:00:01,970 --> 00:00:08,300 Here we are in our clinics machine, and it is time we finally learn how to use that mysterious tool 3 00:00:08,600 --> 00:00:11,900 that is said to be the most important tool that we must master. 4 00:00:12,900 --> 00:00:15,910 Don't worry, terminal is not difficult to use. 5 00:00:16,590 --> 00:00:23,760 But before we get to open it and run a bunch of the commands, let us first define what terminal is. 6 00:00:27,010 --> 00:00:33,690 Terminal is a program that allows us to interact with Linux operating system using different commands, 7 00:00:34,600 --> 00:00:41,170 we can create files, delete files, create directories, run programs, set different tasks to execute, 8 00:00:41,170 --> 00:00:44,200 and we can do many more things using it. 9 00:00:45,060 --> 00:00:51,550 It is important you get used to it, especially if you never used it before, because if you're coming 10 00:00:51,550 --> 00:00:58,780 from Windows or Mac OS, you probably are used to opening files or folders by clicking on different 11 00:00:58,780 --> 00:01:00,880 icons and navigating like that. 12 00:01:01,330 --> 00:01:09,100 For example, on Windows we usually open files by double clicking on an icon and it will open that folder. 13 00:01:10,220 --> 00:01:16,760 And on Linux, we can actually do the same thing, so if we go right here and for example, I want to 14 00:01:16,760 --> 00:01:22,880 open this home folder, I will double click on that folder and it will open the folder with all the 15 00:01:22,880 --> 00:01:24,080 files inside of it. 16 00:01:24,590 --> 00:01:26,990 But we don't want to be doing it like that. 17 00:01:27,680 --> 00:01:30,280 Let us see how we can do it using terminal. 18 00:01:31,220 --> 00:01:35,060 So let us close this first and we already know how to open terminal. 19 00:01:35,300 --> 00:01:35,660 Right. 20 00:01:35,660 --> 00:01:38,990 Click on desktop and click open terminal here. 21 00:01:40,800 --> 00:01:48,480 First thing that we notice is username that we have right here and the host name that we have right 22 00:01:48,480 --> 00:01:53,490 here, but we also noticed this slash desktop. 23 00:01:54,830 --> 00:01:59,780 This means that our terminal process has opened inside of the desktop directory. 24 00:02:00,650 --> 00:02:02,090 Does it always open there? 25 00:02:02,690 --> 00:02:06,650 Nope, it only opened there because we told it to open there. 26 00:02:07,330 --> 00:02:08,420 Remember, we. 27 00:02:08,420 --> 00:02:08,680 Right. 28 00:02:08,690 --> 00:02:11,720 Clicked on desktop and clicked open terminal here. 29 00:02:13,140 --> 00:02:15,480 If we, for example, went to the home folder. 30 00:02:18,760 --> 00:02:22,000 And right, click here, open terminal. 31 00:02:25,110 --> 00:02:29,180 Hmm, it doesn't say home like it did in desktop. 32 00:02:30,140 --> 00:02:31,680 It just gives us this way. 33 00:02:31,680 --> 00:02:32,880 We minus sign. 34 00:02:33,980 --> 00:02:41,960 Well, that sign in Linux means that you are in your home directory of your user and our user is called 35 00:02:41,960 --> 00:02:42,720 Mr. Hacker. 36 00:02:43,100 --> 00:02:45,830 So the director, a name should be at home. 37 00:02:46,220 --> 00:02:46,940 Mr. Hacker. 38 00:02:47,630 --> 00:02:51,940 And to check the directory name, we can type the command P. 39 00:02:52,070 --> 00:03:00,170 W.D. If we press enter, it will give us the current directory in which our terminal process is running 40 00:03:00,860 --> 00:03:02,290 and it is home. 41 00:03:03,240 --> 00:03:04,010 Mr. Hacker. 42 00:03:04,790 --> 00:03:09,530 And this simply stands for print working directory. 43 00:03:10,520 --> 00:03:15,440 If we, for example, go to the folder once again, which is your home folder. 44 00:03:15,810 --> 00:03:16,490 Mr. Hacker. 45 00:03:17,210 --> 00:03:21,530 And we double click on documents, try to open terminal here. 46 00:03:22,010 --> 00:03:23,810 So open terminal here. 47 00:03:24,770 --> 00:03:33,380 This will open a second terminal and you will see right here that it says documents, but do we always 48 00:03:33,380 --> 00:03:39,200 need to go to that folder and open terminal inside of that folder for it to be inside of this directory? 49 00:03:39,950 --> 00:03:40,790 Of course not. 50 00:03:41,390 --> 00:03:43,980 We can use a command called KDDI. 51 00:03:45,370 --> 00:03:49,120 And you should be familiar with this command, since we already used it before. 52 00:03:50,100 --> 00:03:51,180 Let us test it out. 53 00:03:51,810 --> 00:03:58,050 Let's go to the documents directly from our home directory, so we'll just close the second terminal 54 00:03:58,920 --> 00:04:04,430 and wait here we are inside of our home directory or slash home slash Mr. Hacker. 55 00:04:05,760 --> 00:04:11,910 We know that inside of this directory, there is a documents directory since we managed to open it right 56 00:04:11,910 --> 00:04:19,980 here and to navigate to this directory using a terminal, we can use the command CD and then the name 57 00:04:19,980 --> 00:04:22,110 of the directory, which is documents. 58 00:04:25,770 --> 00:04:35,280 We press enter, and here it is, we are in documents directory, if we type here, it will tell us 59 00:04:35,280 --> 00:04:40,260 the current working directory slash home slash Mr. Hacker slash documents. 60 00:04:41,830 --> 00:04:48,100 And for example, if he wanted to go one step or one directory back, if we can type documents, CD 61 00:04:48,280 --> 00:04:49,570 and then two dots. 62 00:04:50,730 --> 00:04:57,870 What this command will do is it will go one directory back, and if I typed up once again, we will 63 00:04:57,870 --> 00:05:01,980 now be again in slash home slash Mr. Hacker directory. 64 00:05:02,960 --> 00:05:07,040 So these two dots tell the terminal to go one directory back. 65 00:05:08,470 --> 00:05:13,830 OK, great, but how can we know which subdirectories and files are in the home directory? 66 00:05:13,840 --> 00:05:19,900 For example, if we knew there was documents that are directly in the folder because we opened it right 67 00:05:19,900 --> 00:05:22,420 here, we didn't open it over terminal. 68 00:05:22,660 --> 00:05:25,750 We opened it right here from our desktop. 69 00:05:28,380 --> 00:05:33,750 Once we open it again, we can see all the folders and files inside of this home. 70 00:05:34,390 --> 00:05:41,880 Mr. Hacker directory, but we didn't see these files inside of our terminal, so how can we lose them? 71 00:05:41,910 --> 00:05:48,480 How can we see all of these files using a terminal so we know which directories are available inside 72 00:05:48,480 --> 00:05:49,770 of this home? 73 00:05:50,220 --> 00:05:57,120 Mr. Hacker directory to check files and folders in any directory we can use another familiar command, 74 00:05:57,270 --> 00:05:58,770 which is Altez. 75 00:05:59,780 --> 00:06:03,500 And the command stands for the list, so let's just test it out. 76 00:06:05,330 --> 00:06:14,240 If we type it, press enter, here we are, we can see same folders and same files that we can see inside 77 00:06:14,240 --> 00:06:15,320 of this window right here. 78 00:06:16,920 --> 00:06:23,670 So what we did for now is we use a terminal instead of clicking on a bunch of files, a bunch of icons, 79 00:06:24,180 --> 00:06:27,390 we now are doing all of that with our terminal. 80 00:06:28,320 --> 00:06:35,070 Now that we know which folders are in this directory, if we can choose which folder we want to go to 81 00:06:35,280 --> 00:06:37,230 and use the command to go there. 82 00:06:38,670 --> 00:06:45,750 But let us go one directory back from this flash home slash, Mr. Hacker, to do that, we already know 83 00:06:45,750 --> 00:06:47,700 we can type CD and then to that's. 84 00:06:49,500 --> 00:06:52,420 And by the way, CD simply stands for Changing Directory. 85 00:06:52,680 --> 00:06:56,070 Don't know if I mentioned that, but CD is changing directory. 86 00:06:57,140 --> 00:07:02,540 And now we can see once we went one directly back, we are in the home directory. 87 00:07:03,510 --> 00:07:04,920 If we type here. 88 00:07:06,310 --> 00:07:12,040 We can see here is our Mr. Hacker directory that is containing these files right here. 89 00:07:13,040 --> 00:07:19,760 Since we went one step back, we can only see Mr. Hacker directory, since this is the only folder inside 90 00:07:19,760 --> 00:07:21,290 of this home directory. 91 00:07:22,230 --> 00:07:24,110 Let's go one more step back. 92 00:07:25,120 --> 00:07:34,870 If I type two dots once again, now I'm in the directory and it is called slash directory because it 93 00:07:34,870 --> 00:07:37,810 is only specified as a Forbert slash. 94 00:07:39,100 --> 00:07:40,940 And we can go more than that. 95 00:07:41,500 --> 00:07:48,310 This is the main directory that has all of the other files and directories in the system if we try to 96 00:07:48,310 --> 00:07:49,530 type code once again. 97 00:07:50,770 --> 00:07:58,120 You will see it will still be in this directory and remember when I told you during Callisthenics installation 98 00:07:58,300 --> 00:08:05,020 that we will shortly see slash home slash tampoe slash VA directories that occurred in one of the installation 99 00:08:05,020 --> 00:08:05,600 questions? 100 00:08:06,160 --> 00:08:08,650 Well, if I type s right here. 101 00:08:11,600 --> 00:08:17,000 These are all just standard business directories and here is home from which we came from. 102 00:08:18,630 --> 00:08:20,100 Here is Mark. 103 00:08:21,130 --> 00:08:22,810 And here is the MP. 104 00:08:24,050 --> 00:08:29,660 And a bunch of other directories, and these are all just standard Linux directories. 105 00:08:31,120 --> 00:08:35,200 From here, you will notice that not all of it is same color. 106 00:08:36,190 --> 00:08:42,670 This is because not all of the stuff we see here is the same thing, something is a directory, something 107 00:08:42,670 --> 00:08:47,990 is a file, and for example, we cannot use CD comment onto a file. 108 00:08:48,400 --> 00:08:51,250 We can only use it to go to another directory. 109 00:08:52,030 --> 00:08:54,190 So if we try, for example, CD. 110 00:08:55,420 --> 00:08:58,720 And I chose this file, so in it. 111 00:09:00,940 --> 00:09:04,870 Hardy thought IMG and press enter. 112 00:09:05,820 --> 00:09:09,870 This will not work, it will give us an error saying not to directory. 113 00:09:10,950 --> 00:09:18,150 But if a type CD and then at sea, for example, which is this directory and press enter now, I will 114 00:09:18,150 --> 00:09:25,530 be inside the ETSI directory and here I can type Altez to list all of the files inside of the ETSI directory. 115 00:09:26,070 --> 00:09:31,260 And you will also notice that here we got a mixture of files and directories as well. 116 00:09:32,160 --> 00:09:35,160 Directories are these dark blue names. 117 00:09:36,400 --> 00:09:40,390 While files can be other colors depending on file type. 118 00:09:41,370 --> 00:09:42,750 Usually they are white. 119 00:09:44,480 --> 00:09:45,350 OK, great. 120 00:09:45,740 --> 00:09:50,460 We learned the basics of navigating through the system and directories, using different commands. 121 00:09:51,230 --> 00:09:54,440 Now, before we finish this video, here is a practice test. 122 00:09:55,430 --> 00:10:03,160 Try returning to the desktop directory from this Etsy directory, using only the comments that we learned. 123 00:10:04,070 --> 00:10:07,930 I will give you right now a few seconds and I will show you how to do it. 124 00:10:09,020 --> 00:10:10,130 So try it out. 125 00:10:14,980 --> 00:10:19,000 OK, don't worry, if you didn't get it, this will come with practice. 126 00:10:19,240 --> 00:10:20,740 So here it is, how we can do it. 127 00:10:21,700 --> 00:10:32,260 From the ATSE directory, we know that we must go back to the directory and in this directory we got 128 00:10:32,260 --> 00:10:39,280 our home directory, we can check it out by typing Altez And inside of this home directory, we know 129 00:10:39,280 --> 00:10:44,740 that we got the Mr. Hacker directory and the Mr. Hacker directory has the desktop directory. 130 00:10:45,340 --> 00:10:47,920 So to navigate there, we can type CD home. 131 00:10:49,820 --> 00:10:58,690 Here then type CD, Mr. Hacker type here once again to check out all of the available directories and 132 00:10:58,690 --> 00:11:00,220 see the desktop. 133 00:11:01,600 --> 00:11:09,270 And now we are on our test of the rectory once again, great, so practice a little bit with these commands. 134 00:11:09,460 --> 00:11:10,840 This is nothing really too hard. 135 00:11:10,850 --> 00:11:14,280 Just take some practice and you will get used to it pretty soon. 136 00:11:14,770 --> 00:11:21,430 And in the next video, we're going to see how we can create files and folders using terminal as well 137 00:11:21,430 --> 00:11:24,280 as we are going to see how we can run programs. 138 00:11:25,320 --> 00:11:25,880 See you there.