WEBVTT 00:06.760 --> 00:11.920 In this video you're going to go through a command line Crash Course which will help you muster the 00:11.920 --> 00:16.860 command line and be able to use these for node or any other environments. 00:16.900 --> 00:24.340 So this is going to consist of a list of commands which will help you understand and learn the command 00:24.340 --> 00:25.950 line by doing so. 00:25.960 --> 00:28.250 Let's start with our first example. 00:28.270 --> 00:29.400 Who am I. 00:29.500 --> 00:34.180 This command will tell you the user who is currently logged in. 00:34.180 --> 00:35.050 So let's try it 00:37.940 --> 00:43.070 and you can see by this I am currently logged in as Dave island. 00:43.280 --> 00:46.980 So I suggest going for this layout to make things easy for you. 00:47.150 --> 00:53.300 So call the terminal on the right hand side and of course the file explorer or the window Explorer on 00:53.300 --> 00:55.650 the left hand side. 00:55.730 --> 00:55.970 All right. 00:55.970 --> 00:59.540 So now let's move to the next example. 00:59.620 --> 01:02.530 Now you can decide to become routes. 01:02.590 --> 01:07.310 So the routes user is a user with a superpower. 01:07.330 --> 01:10.110 Basically the rules can do anything on the computer. 01:10.120 --> 01:14.230 This includes the impotence files like system files. 01:14.260 --> 01:18.130 Obviously this is not recommended but this is the way to do it. 01:18.160 --> 01:25.480 It's by running this command sudo minus I do if I try that now 01:30.110 --> 01:32.680 it's going to ask you for the password. 01:32.680 --> 01:37.000 This is the password you used to log into your computer and now you can see that I am looks in eyes 01:37.060 --> 01:39.730 roots and I can try. 01:39.730 --> 01:40.440 Who am I again. 01:42.230 --> 01:51.530 And you can see that's the current user is right now you can decide to go back to the first user by 01:51.560 --> 01:59.630 typing s you the user you want. 02:00.670 --> 02:03.330 So you don't have to worry about that error if you type. 02:03.340 --> 02:08.810 Well right now it's going to tell you that you are currently logged in US debt island. 02:08.830 --> 02:09.400 All right. 02:09.400 --> 02:14.760 So you don't see the same thing there. 02:14.920 --> 02:18.000 You see bus minus three point two. 02:18.040 --> 02:18.280 All right. 02:18.280 --> 02:23.400 So all you need to do is just restart your terminal and you can recover. 02:23.400 --> 02:23.680 That's 02:29.750 --> 02:30.030 right. 02:30.480 --> 02:30.750 All right. 02:30.760 --> 02:36.160 So now let's move to the next example where I am. 02:36.160 --> 02:42.080 So this command will tell you the current directory where you are at the moment. 02:42.100 --> 02:54.440 So if it's IP WD It will tell me that I am currently in route for as Slash uses for Slash Dev island. 02:54.440 --> 03:01.700 So basically when I log in ask Dave island automatically directly to this directory I am most in the 03:01.760 --> 03:03.800 root directory of the computer. 03:03.800 --> 03:11.500 By the way so to go to the root directory of the computer I need another command which is. 03:12.350 --> 03:17.020 So D will help you move to another directory. 03:17.090 --> 03:17.840 All right. 03:17.860 --> 03:31.160 So if I want to check what's inside this directory first I can type errors and it will tell me what's 03:31.160 --> 03:35.300 inside the island folder. 03:35.340 --> 03:40.260 These are the different folders I can see and these are the same ones thus you will see if you open 03:40.260 --> 03:41.870 your your explorer. 03:42.240 --> 03:52.050 So does the desktop documents etc. So if I want to go to any of these from here I can just type see 03:52.050 --> 03:59.900 these then type the name of the folder I don't have to finish the whole name on the folder I can just 04:00.440 --> 04:04.380 press tab and it will give me a suggestion. 04:04.400 --> 04:12.100 All right so I'm going to click onto now and now I am inside the desktop and to check that I can type 04:12.100 --> 04:17.590 BW D where I am. 04:17.710 --> 04:24.030 This is telling me that I am currently inside the desktop folder which is located there. 04:24.180 --> 04:29.610 All right now to see the different files and folders inside the desktop you type colors again. 04:30.010 --> 04:34.350 And here are the different folders and files inside the desktop. 04:34.900 --> 04:37.310 And this is matching with the Explorer. 04:37.420 --> 04:45.250 Now if you want to move to another directory using the full path of the directory you can still use 04:45.250 --> 04:49.030 CDE followed by the full path of the directory. 04:49.030 --> 05:00.570 So for example if I want to go to the users folder I can just type CDE for Slash uses for Slash. 05:01.030 --> 05:09.010 And if I do p WD then I can see that I am inside the users folder to go to the root directory. 05:09.100 --> 05:12.990 I can type C.D. forward slash. 05:13.180 --> 05:14.530 All right. 05:14.790 --> 05:22.260 And if I do p WD I can see that I am inside the root directory of my computer and typing Ellis will 05:22.270 --> 05:28.870 tell me what's folders and files I've got inside this directory. 05:28.870 --> 05:32.750 All right so now let's move to something else. 05:32.800 --> 05:37.330 So if you want to move up one directory you can use this syntax. 05:37.360 --> 05:44.530 So see these space followed by two dots if you want to move to a relative but you can still use the 05:44.560 --> 05:46.120 two dots syntax. 05:46.120 --> 05:49.620 So for example here we are moving up one directory. 05:49.750 --> 05:55.830 Then we move we're not going to get again another directory and then we move into the directory we want. 05:55.840 --> 05:59.230 So let's try this. 05:59.230 --> 06:03.770 So at the moment I mean side this folder. 06:04.060 --> 06:11.330 So let's move up one directory so this is where I am right now. 06:11.350 --> 06:17.030 All right so now let's move to the node for that for example so 06:20.670 --> 06:21.610 so let's go to 06:28.660 --> 06:31.260 defining the first statistic what we call the inside. 06:31.270 --> 06:36.270 So C.D. Dave Ireland then 06:39.780 --> 06:44.560 desktop and then note. 06:44.720 --> 06:47.150 So this is where I am at the moment. 06:47.180 --> 06:56.330 All right so now let's say that I want to move up to directories and then move to a directory inside 06:56.750 --> 06:58.520 Dave island. 06:58.520 --> 06:59.350 All right. 06:59.360 --> 07:03.050 So inside of Ireland we've got these directories. 07:03.050 --> 07:07.980 So let's say that we want to move to downloads. 07:08.180 --> 07:14.710 So first let's move up one directory like that and then another one. 07:14.720 --> 07:18.440 Now let's move to the downloads 07:21.030 --> 07:21.650 folder. 07:21.750 --> 07:27.400 So if I press tab then it suggests this wall there so let's see. 07:27.420 --> 07:30.610 And this is our current form. 07:31.560 --> 07:31.820 All right. 07:31.830 --> 07:35.060 So let's try something else. 07:35.700 --> 07:40.400 Now let's create a directory named node course. 07:40.410 --> 07:43.910 So the syntax is make directory like that. 07:43.950 --> 07:51.280 So let's try those so we're going to go back to the node folder. 07:51.820 --> 07:54.380 So let's move up one directory. 07:54.410 --> 08:04.050 Now we are inside the violent and now let's move to the desktop and then to note. 08:04.370 --> 08:08.500 So this is where we are the moment we are inside this folder. 08:08.510 --> 08:09.980 Now let's create our directory. 08:09.980 --> 08:16.810 So make directory node course and you can see our directory created. 08:16.940 --> 08:17.400 Right. 08:17.930 --> 08:20.000 Perfect all right. 08:20.000 --> 08:23.670 So let's try something else. 08:23.730 --> 08:28.020 Now we want to list elements inside the node directory. 08:28.020 --> 08:30.590 So this is something that we covered already. 08:30.690 --> 08:37.470 So you can just type errors or type the full path of the directory like that. 08:37.860 --> 08:52.010 So Ellis will tell you that's there is one for the right and if you want you can also type M is the 08:52.040 --> 08:58.180 full path of node and you'll get the same results. 08:58.540 --> 09:02.680 So the difference between that and that is that you run this inside the same folder. 09:02.680 --> 09:05.020 So we are inside the node for the there. 09:05.020 --> 09:09.200 That's why we typed Ellis like that. 09:09.460 --> 09:11.920 This one can be used anywhere. 09:11.920 --> 09:18.760 So if you go to the root root directory for example you can still type these same comments I'm going 09:18.760 --> 09:19.940 to use the history here. 09:20.040 --> 09:27.840 So if I use the up and down buttons it up and then up that gives me the command that I run that so he 09:27.840 --> 09:32.300 can just press enter and it's going to run the same command. 09:32.310 --> 09:38.490 All right so I've just run this command from the root directory and it still works. 09:38.580 --> 09:41.370 All right so now let's go back to our need for the 09:49.680 --> 09:50.300 by the way. 09:50.300 --> 09:52.630 You can copy things like that. 09:52.640 --> 09:57.000 So using the copy control command see and then command V. 09:57.080 --> 10:00.290 Otherwise you can just do something like this. 10:00.290 --> 10:07.360 So if whites select bets and I just drag it and drop it anywhere it's going to copy it's like like that's 10:07.460 --> 10:09.870 all right. 10:10.210 --> 10:10.490 Okay. 10:10.520 --> 10:12.410 So now we are back to the note folder. 10:13.010 --> 10:16.880 So let's go to the next example. 10:16.910 --> 10:21.190 Now we want to remove the directory named node course. 10:22.150 --> 10:30.530 All right so first of all we're going to be using another command called remove or remove directory. 10:30.560 --> 10:35.560 Now there is a very useful command called Man which stands for manual. 10:35.600 --> 10:38.650 So this one will give you information about a certain command. 10:38.660 --> 10:40.800 So let's try that on remove. 10:41.960 --> 10:44.210 So manual remove. 10:44.900 --> 10:54.600 So this will give you berries for bits of information about how to use the R.M. command. 10:54.640 --> 10:58.690 So these are the options that you can use with that command. 10:58.760 --> 11:03.200 And it explains here what each of option stands for. 11:03.590 --> 11:11.470 So for example minus r will remove the file hierarchy. 11:11.470 --> 11:14.300 All right rooted in each file argument. 11:14.300 --> 11:23.250 So if you use this with a folder for example then it's going to remove everything inside that folder. 11:23.750 --> 11:31.590 So if you try minus f it's going to remove things without prompting for confirmation. 11:31.590 --> 11:32.290 All right. 11:32.380 --> 11:35.580 So let's try this so to exit this. 11:35.860 --> 11:46.810 I'm gonna press cube for quids so now let's remove our folder node course. 11:46.920 --> 11:54.150 So first of all I'm going to use R.M. I'm gonna use remove directory and this one can be used with an 11:54.150 --> 11:56.460 empty directory early so 11:59.880 --> 12:02.520 that's it. 12:02.540 --> 12:09.010 So if I do this then I've just deleted the nodes cause directory. 12:09.030 --> 12:09.190 Right. 12:09.200 --> 12:10.100 So let's create again 12:17.340 --> 12:20.520 and I'm gonna open this using brackets 12:23.470 --> 12:25.080 because it opened already. 12:25.140 --> 12:33.150 This will make things easy for us to create files etc. So when it creates a new file inside Newt goes 12:33.190 --> 12:41.050 I'm going to call it up but days I'm going to create another folder inside this I'm going to call it 12:42.340 --> 12:48.740 she says for example and a new filing SCA says quality silos. 12:48.750 --> 12:49.240 Yes yes. 12:49.910 --> 12:55.820 So now we've got our folder node course and inside it we of course files and folders. 12:55.820 --> 12:59.490 Now let's say we want to remove everything inside the folder. 12:59.490 --> 13:03.110 No of course and the folder itself. 13:03.590 --> 13:11.270 So if you do this you use the R.M. command and then you use the options. 13:11.270 --> 13:18.200 So let's say that we want to remove everything or we use the minus r 13:21.380 --> 13:27.100 option and also we want to avoid the confirmation prompts. 13:27.230 --> 13:33.320 So to do that we're going to use the F option and you can combine these by typing minus RF. 13:34.010 --> 13:43.100 So if I do this then it's going to delete the whole folder with everything inside. 13:49.770 --> 13:56.230 Now let's move to the next one so let's create a file up those J.S.. 13:56.940 --> 14:00.710 So to create a file. 14:00.780 --> 14:04.730 Use the touch command. 14:04.810 --> 14:09.400 And here is our file perfect. 14:09.480 --> 14:13.020 Now let's check permissions of our file. 14:13.020 --> 14:24.580 So permissions are the different rights that you give to different types of users. 14:24.700 --> 14:30.010 When it comes to ISIS and file so some users can read a file. 14:30.040 --> 14:34.490 Some users can read and write inside a file a file. 14:34.570 --> 14:39.600 Some users can execute an executable file and so on. 14:39.640 --> 14:42.700 So there are two now three types of users. 14:42.700 --> 14:51.780 So this user is the one who owns the file. 14:53.860 --> 14:59.130 This one is the group to which this user belongs to. 14:59.140 --> 15:05.560 So on your computer you can create groups and each user can belong to a certain group and then other 15:06.190 --> 15:09.470 is everyone else. 15:09.490 --> 15:13.180 Now the permissions are read so you can read the file right. 15:13.210 --> 15:18.540 You can change the file right inside is edit it executes. 15:18.550 --> 15:22.550 You can actually execute the file if it's an executable. 15:23.100 --> 15:23.420 OK. 15:23.460 --> 15:32.750 So now to check the permissions you just type Ellis and then the option here is l All right. 15:32.760 --> 15:34.430 So let's try that with our file. 15:34.660 --> 15:43.030 So I'm going to try and is minus l up not chance and you can see here but we've got read and rights 15:43.890 --> 15:53.380 for the owner and then read only for the group and then read only for everyone else. 15:53.610 --> 15:58.010 Okay so let's move to the next one. 15:58.230 --> 16:05.310 Now you can add a permission to a type of uses. 16:05.470 --> 16:08.220 So let's say that we want to are the executes. 16:08.290 --> 16:12.680 Permission to be type group. 16:12.820 --> 16:17.510 So to do does use the command change mode. 16:17.600 --> 16:17.840 Okay. 16:17.840 --> 16:19.540 So sage mode. 16:19.730 --> 16:33.550 So let's try this CCH Modise so we start with the type of user so we are looking here as the type group 16:33.910 --> 16:41.260 and we adding the execute rights which is x and our file is up both deaths. 16:42.040 --> 16:53.590 So now if we try again and S minus l Abdul Jess you can see that this time the group can actually read 16:54.580 --> 16:55.540 and execute 17:02.540 --> 17:04.280 so just to avoid confusion. 17:04.290 --> 17:11.730 So the three characters that you see here belong to the owner and then these three characters belong 17:11.730 --> 17:17.000 to regroup and then these three characters belong to everyone else. 17:17.010 --> 17:17.940 So when you see 17:20.750 --> 17:24.050 a combination like bus it's read write and execute. 17:24.140 --> 17:30.340 So we don't have the x ray that this means that this group can't execute this file. 17:30.360 --> 17:30.660 All right. 17:31.130 --> 17:39.500 And then the first character that you see in our case each is showing a minus sign. 17:39.570 --> 17:44.550 This is referring to a type of item we are dealing with. 17:44.550 --> 17:47.370 So in our case it's a normal file. 17:47.430 --> 17:50.520 So that's why it's Hayes minus. 17:50.520 --> 17:59.990 If this was a four there for example or right directory then you would see d that instead okay. 18:00.340 --> 18:00.750 All right. 18:00.770 --> 18:06.020 In the next video you're going to move to the next example where you're going to deal with permissions 18:06.230 --> 18:09.620 using a simpler model using numbers.