1 00:00:00,000 --> 00:00:01,380 [No audio] 2 00:00:01,380 --> 00:00:05,970 File system paths. Here we will talk about how we 3 00:00:05,970 --> 00:00:09,390 could navigate the file system through the 4 00:00:09,420 --> 00:00:13,110 absolute path or relative path. So, so basically 5 00:00:13,110 --> 00:00:17,490 there are two paths to navigate a file system. The 6 00:00:17,490 --> 00:00:21,240 first one is the absolute path and the second one 7 00:00:21,240 --> 00:00:24,630 is the relative path. An absolute path always 8 00:00:24,630 --> 00:00:28,680 begins with a slash. This indicates that the path 9 00:00:28,680 --> 00:00:32,250 starts at the root directory. An example of an 10 00:00:32,250 --> 00:00:37,980 absolute path is if you are going to go into the 11 00:00:37,980 --> 00:00:42,420 samba directory, which is in /var/log directory, it 12 00:00:42,420 --> 00:00:45,660 has two directories above it. So you could start 13 00:00:45,660 --> 00:00:50,910 with cd /var/log/samba will 14 00:00:50,910 --> 00:00:55,890 take you directly to a samba folder. By the way, 15 00:00:55,920 --> 00:00:59,850 this is just an example that I picked up for, 16 00:00:59,850 --> 00:01:03,630 to make you understand about the absolute path. 17 00:01:04,709 --> 00:01:07,590 Then we have the relative path which does not 18 00:01:07,590 --> 00:01:12,270 begin with slash. It identifies a location, relative 19 00:01:12,270 --> 00:01:15,390 to your current position. An example of relative 20 00:01:15,390 --> 00:01:22,140 path is you cd into /var. Once you are 21 00:01:22,140 --> 00:01:26,640 already in var, you could just do cd logs. Now, 22 00:01:26,640 --> 00:01:30,570 you notice we are now using slash log because we 23 00:01:30,570 --> 00:01:34,860 are already in var directory. And we could just 24 00:01:34,860 --> 00:01:39,030 simply go into cd log and then from there, we 25 00:01:39,030 --> 00:01:43,050 could cd into samba. Again here we are not using 26 00:01:43,050 --> 00:01:46,650 slash log or slash samba because they do not begin 27 00:01:46,650 --> 00:01:49,710 with slash, they are within the slash var 28 00:01:49,710 --> 00:01:55,290 directory. So let's look at the example okay. So, 29 00:01:55,290 --> 00:02:00,312 first thing you have to do is become root user. su dash, 30 00:02:00,312 --> 00:02:05,768 [No audio] 31 00:02:05,768 --> 00:02:08,008 you put it in password. Now, if you 32 00:02:08,008 --> 00:02:11,310 wanted to go directly to the samba folder, you 33 00:02:11,310 --> 00:02:17,370 could just go cd slash var slash log slash samba. 34 00:02:17,370 --> 00:02:19,650 [No audio] 35 00:02:19,650 --> 00:02:24,570 Where are you? You are in var log samba. Now if 36 00:02:24,570 --> 00:02:27,120 you notice, if you go through the relative path, 37 00:02:27,150 --> 00:02:32,400 which means let's got to slash, we are in root 38 00:02:32,430 --> 00:02:35,280 directory, slash directory, and if you want to go 39 00:02:35,280 --> 00:02:39,630 to the var directory, you could simply do var, or 40 00:02:39,630 --> 00:02:43,530 you could also do var. Once you in this directory, 41 00:02:43,710 --> 00:02:45,990 and if you try to do at this point, if you try to 42 00:02:45,990 --> 00:02:51,000 do cd slash log, it's not going to find it because 43 00:02:51,240 --> 00:02:53,850 what you're trying to tell the operating system 44 00:02:53,850 --> 00:02:58,110 that there is a log directory within the slash 45 00:02:58,110 --> 00:03:01,410 directory, which is not the case. So how are we 46 00:03:01,410 --> 00:03:06,690 going to get into the log, is by simply cd log, and 47 00:03:06,690 --> 00:03:09,810 if you do pwd, you will see you are in var log. 48 00:03:09,990 --> 00:03:12,900 Now if you wanted to go into one more directory, 49 00:03:13,530 --> 00:03:17,280 which is samba, what command would you run, cd 50 00:03:17,640 --> 00:03:22,078 slash samba, or cd samba. 51 00:03:22,078 --> 00:03:24,130 [No audio] 52 00:03:24,130 --> 00:03:26,010 Well, you will run cd 53 00:03:26,010 --> 00:03:28,500 samba, and it will take you to the samba 54 00:03:28,500 --> 00:03:31,830 directory, and you do pwd, it will tell you you 55 00:03:31,830 --> 00:03:36,000 are in var slash log slash samba directory. So 56 00:03:36,000 --> 00:03:39,240 this is the main difference between the absolute 57 00:03:39,240 --> 00:03:42,600 path and the relative path. And the reason you use 58 00:03:42,600 --> 00:03:44,880 these two different paths is because if you 59 00:03:44,880 --> 00:03:47,460 already know the directory where you want to go 60 00:03:47,460 --> 00:03:49,980 in, you don't have to go into one directory, then 61 00:03:49,980 --> 00:03:53,070 the second, third, or fourth, you could directly go 62 00:03:53,070 --> 00:03:57,480 into the path of the directory, in our case, which 63 00:03:57,480 --> 00:04:02,610 is again, var slash log slash samba. And there 64 00:04:02,610 --> 00:04:05,340 you are. And for example, if you want to go to 65 00:04:05,340 --> 00:04:08,316 another directory, let's say we're going to cd etc 66 00:04:08,316 --> 00:04:14,430 sysconfig and network-scripts, you could 67 00:04:14,430 --> 00:04:18,120 just do that and it will take you there. By the 68 00:04:18,120 --> 00:04:21,209 way, if you hit tab, it will autocomplete your 69 00:04:21,209 --> 00:04:23,610 directory if it exists in there. Now you which 70 00:04:23,610 --> 00:04:25,709 directory you are in? You're in etc sysconfig 71 00:04:25,709 --> 00:04:27,930 network-scripts. If you want to get out of from 72 00:04:27,930 --> 00:04:31,950 one directory you do cd dot dot. Where are you? 73 00:04:32,550 --> 00:04:35,280 You are in etc sysconfig. You want to go one 74 00:04:35,280 --> 00:04:40,140 step back, you do cd dot dot, and you are an etc. 75 00:04:40,380 --> 00:04:43,140 If you want to go one more directory out, you 76 00:04:43,140 --> 00:04:48,180 do cd dot dot, and you do, and you are into slash 77 00:04:48,180 --> 00:04:51,600 directory, again, the root directory, the main 78 00:04:52,380 --> 00:04:53,580 parent directory. 79 00:04:53,970 --> 00:04:57,810 So that's what this lecture is about, to 80 00:04:57,810 --> 00:05:01,110 tell you the difference between the 81 00:05:01,110 --> 00:05:03,162 absolute path and relative path. 82 00:05:03,162 --> 00:05:04,832 [No audio]