1 00:00:07,110 --> 00:00:12,360 So we've seen some useful commands for getting around the command prompt in Lennix, few useful commands 2 00:00:12,360 --> 00:00:12,900 for files. 3 00:00:13,230 --> 00:00:15,240 Let's see just a few more advanced commands. 4 00:00:15,600 --> 00:00:18,120 We're gonna see how to get help on commands. 5 00:00:18,650 --> 00:00:23,430 We'll use the super user, do command, and then we'll see some things that we can use to find a file 6 00:00:23,460 --> 00:00:27,810 or to do a little bit of networking, checkup and other advanced features. 7 00:00:28,590 --> 00:00:34,080 So first of all, any time we want to do something with elevated privileges, something that a super 8 00:00:34,080 --> 00:00:36,480 user, a route or administrator would do. 9 00:00:36,720 --> 00:00:42,150 We use the super user do or pseudo sue, do as you know, super user do. 10 00:00:42,930 --> 00:00:44,460 You'll hear people call it pseudo. 11 00:00:44,900 --> 00:00:45,960 We'll say pseudo. 12 00:00:46,260 --> 00:00:47,900 And then we'll give it command. 13 00:00:48,000 --> 00:00:50,880 That would impact the system or install software. 14 00:00:50,910 --> 00:00:56,610 So if we do a pseudo apte get install, say, Python three. 15 00:00:58,360 --> 00:01:05,010 Then that would let us run as an administrative user and install some software using the APTN get. 16 00:01:05,470 --> 00:01:08,830 So the app to get installed, Python three, would go out and find Python three. 17 00:01:08,870 --> 00:01:10,120 I'm not going to do that right now. 18 00:01:10,720 --> 00:01:12,640 Sometimes you want to restart services. 19 00:01:12,640 --> 00:01:14,890 For example, you might say pseudo service. 20 00:01:15,490 --> 00:01:18,750 Network manager restart. 21 00:01:20,130 --> 00:01:22,060 And that will restart our networking for us. 22 00:01:22,960 --> 00:01:27,350 Meaning tell me to do something with elevator privileges looking inside other user directories. 23 00:01:27,370 --> 00:01:33,070 For example, if you're doing a search, you may have to do a studio to find out where files are located. 24 00:01:33,460 --> 00:01:39,400 Well, speaking of finding where files are located, let's see to our the root of the machine, not 25 00:01:39,400 --> 00:01:42,610 our root home directory CV to the base file system. 26 00:01:42,610 --> 00:01:44,220 Enough I do a L. 27 00:01:44,230 --> 00:01:49,060 S, I can see I'm out at the base of this Caleigh Linux machine. 28 00:01:49,600 --> 00:01:56,440 I've got things like user cysts, temp, lots of home folders there for our users. 29 00:01:56,830 --> 00:02:01,900 So I've studied space selection at Forward Slash takes me to the root of the file system. 30 00:02:02,860 --> 00:02:07,090 And now I can do I find command, find Dasch name. 31 00:02:07,300 --> 00:02:11,620 Let's find all the user's desktop folders. 32 00:02:13,120 --> 00:02:18,130 Well, it turns out we've just installed a basic Kelly Linux box here, so there's only one desktop 33 00:02:18,400 --> 00:02:19,990 and it's in my folder route. 34 00:02:22,450 --> 00:02:27,760 But let's say we wanted to find all the files named desktop or with desktop in the name at all, we 35 00:02:27,760 --> 00:02:29,500 can use the locate command. 36 00:02:31,070 --> 00:02:34,150 And we can locate desktop. 37 00:02:37,110 --> 00:02:42,140 You see, there are lots of places in a default, Kelly, Linux install that have desktop in the file 38 00:02:42,140 --> 00:02:42,530 name. 39 00:02:43,400 --> 00:02:44,810 Let's say that we created one. 40 00:02:44,840 --> 00:02:50,930 So let's let's clear the screen and let's create a file called desktop right here. 41 00:02:51,320 --> 00:02:54,800 So I m k d i r desktop. 42 00:02:57,270 --> 00:02:59,120 And unify LDS. 43 00:03:00,500 --> 00:03:01,580 I see my new folder. 44 00:03:01,600 --> 00:03:02,690 Desktop is here. 45 00:03:03,140 --> 00:03:06,980 So now if I do a locate, if I do a locate desktop. 46 00:03:08,590 --> 00:03:11,830 You see, it doesn't find that base directory desktop. 47 00:03:12,250 --> 00:03:14,500 Well, that's because I have to update the DBI. 48 00:03:16,330 --> 00:03:24,940 The locate is a quick indexed search for files and the DBE, the update DBI command will now let us 49 00:03:25,990 --> 00:03:28,200 locate desktop. 50 00:03:30,010 --> 00:03:31,540 And notice it has found it now. 51 00:03:31,810 --> 00:03:34,710 And that's much faster than doing a find by name. 52 00:03:34,720 --> 00:03:38,150 Find that name because it's an indexed search. 53 00:03:38,320 --> 00:03:43,300 So that update DBI goes through all the directories and finds all the files locate is a really quick 54 00:03:43,300 --> 00:03:44,770 way to find files when you need to. 55 00:03:45,490 --> 00:03:48,130 Another really useful command is the manual command. 56 00:03:48,190 --> 00:03:56,880 So if I say man locate, it gives me the entire manual on the locate command and I can control see or 57 00:03:57,010 --> 00:04:03,670 actually I can cue to get out of this or I can just say locate space and then do a dash dash help. 58 00:04:04,330 --> 00:04:10,570 In fact, just about all of the commands in Linux, I can do a man space in the name of the command 59 00:04:10,630 --> 00:04:16,870 or I can do the command and then space dash dash help and I'll get more information. 60 00:04:18,880 --> 00:04:20,890 Let me demonstrate that with the copy command. 61 00:04:21,100 --> 00:04:22,650 I can do man c.p. 62 00:04:23,020 --> 00:04:28,390 I see the manual for the copy command and there are lots of commands under there and I'll quit to get 63 00:04:28,390 --> 00:04:28,960 out of there. 64 00:04:29,140 --> 00:04:36,190 Or I can say CPS space dash dash help get one big long help screen. 65 00:04:37,210 --> 00:04:40,180 With all the command line options for the copy command. 66 00:04:41,250 --> 00:04:42,000 Very cool. 67 00:04:42,330 --> 00:04:46,080 Let's do a couple of advanced commands for networking, let's say that I want to ping. 68 00:04:46,380 --> 00:04:48,630 W w w dot Google dot com. 69 00:04:49,050 --> 00:04:54,960 Ping is a network command that lets us see whether we've got connectivity out to the Internet, for 70 00:04:54,960 --> 00:04:56,610 example, or to a specific server. 71 00:04:56,940 --> 00:04:58,680 I'm pinging Google and that's going to keep going. 72 00:04:58,680 --> 00:04:59,610 So I'll control. 73 00:04:59,640 --> 00:05:04,470 See, anytime you want to kill a command from the command, prompt control see is usually the way to 74 00:05:04,470 --> 00:05:04,890 do it. 75 00:05:05,550 --> 00:05:11,520 But I can ping out to Google because this is set up public or I could ping around to other locations 76 00:05:12,150 --> 00:05:15,600 if I clear the screen and do an I f config. 77 00:05:16,740 --> 00:05:18,330 This is my interface config. 78 00:05:18,420 --> 00:05:25,470 I-F config tells me that I am setup with this internet address and I always have a looped back address 79 00:05:25,840 --> 00:05:27,480 127 to zero dot zero. 80 00:05:27,480 --> 00:05:29,490 That one is always my local host. 81 00:05:29,910 --> 00:05:32,460 That is my loop back or a local host address. 82 00:05:32,910 --> 00:05:38,280 But out on the Internet it looks like I have an address like 10 dot audette to that 15 because of the 83 00:05:38,280 --> 00:05:40,650 default setup in virtual box. 84 00:05:41,310 --> 00:05:46,830 So remember, on a Linux box, anytime you need to know your IP address, you can use I-F config interface 85 00:05:46,830 --> 00:05:48,990 config on a Windows machine. 86 00:05:48,990 --> 00:05:50,280 That'll be IP config. 87 00:05:50,310 --> 00:05:52,380 So it's easy to get those mixed up. 88 00:05:52,680 --> 00:05:56,370 Just remember I-F config for Linux and then IP for Windows. 89 00:05:57,330 --> 00:05:58,320 Let me clear the screen. 90 00:05:59,190 --> 00:06:03,750 And one last thing that's helpful to do sometimes is just list all your environment variables. 91 00:06:03,780 --> 00:06:05,190 E in the. 92 00:06:07,750 --> 00:06:10,490 And you can see every named constant. 93 00:06:11,060 --> 00:06:17,510 So if I say want to know where my home directory is or what my user name is, I can echo those variables 94 00:06:17,510 --> 00:06:20,930 out just by using a dollar sign next to this. 95 00:06:21,530 --> 00:06:23,300 The name of the variable that we see here. 96 00:06:23,780 --> 00:06:33,000 So let me clear the screen and echo dollar sign user and I'm logged in as root, whereas my home directory. 97 00:06:33,050 --> 00:06:37,340 I go to our sign home says slash root. 98 00:06:37,480 --> 00:06:45,410 So if I see enter and then my home directory and I can check that with P WD, my present working directory. 99 00:06:46,610 --> 00:06:51,080 So we had a whole lot of Linux commands in there from Ellis all the way through P WD. 100 00:06:51,090 --> 00:06:53,900 We've seen some networking commands, some file commands. 101 00:06:54,290 --> 00:06:56,270 It's a lot to catch all at one time. 102 00:06:56,270 --> 00:07:00,990 So I'll post the PDA file so that you get a good cheat sheet to go back to in the next list. 103 00:07:01,000 --> 00:07:05,270 And we're going to see how to do the same commands in a Windows command line environment.