1 00:00:00,000 --> 00:00:01,510 [No audio] 2 00:00:01,510 --> 00:00:05,074 cd or change directory into our directory. 3 00:00:05,182 --> 00:00:07,270 Meaning, when you're trying to run the command 4 00:00:07,330 --> 00:00:09,990 cd and you're trying to go to another 5 00:00:10,100 --> 00:00:13,494 directory that's where you are having an issue 6 00:00:13,592 --> 00:00:15,402 or you're getting an error message. 7 00:00:15,596 --> 00:00:16,674 So why is that? 8 00:00:16,712 --> 00:00:17,754 And that is what we're going 9 00:00:17,792 --> 00:00:20,554 to troubleshoot today in this lecture. 10 00:00:20,662 --> 00:00:24,354 So there are a few steps that we could 11 00:00:24,392 --> 00:00:28,110 take to actually isolate these type of issues. 12 00:00:28,280 --> 00:00:32,082 And when you cannot get into a directory, of 13 00:00:32,095 --> 00:00:34,640 course there are few things you need to check, 14 00:00:35,090 --> 00:00:36,450 a few things to keep in mind, 15 00:00:36,500 --> 00:00:38,840 and those are the things I wanted to list today. 16 00:00:39,170 --> 00:00:40,520 First thing first. 17 00:00:41,210 --> 00:00:42,730 Directory does not exist. 18 00:00:42,790 --> 00:00:43,902 It's just that simple. 19 00:00:43,976 --> 00:00:46,398 So you are trying to cd into a 20 00:00:46,424 --> 00:00:49,582 directory or a folder, but you cannot. 21 00:00:49,666 --> 00:00:51,262 And the error message that you're 22 00:00:51,286 --> 00:00:53,310 getting is directory does not exist. 23 00:00:54,890 --> 00:00:58,194 Try to read that message, the output, the 24 00:00:58,232 --> 00:01:00,102 error, what it is saying to you. 25 00:01:00,116 --> 00:01:02,482 It's saying the directory does not exist. 26 00:01:02,626 --> 00:01:08,966 So either you actually have an incorrect spelling 27 00:01:09,098 --> 00:01:12,182 of the directory, you finger typed, you fat fingered 28 00:01:12,206 --> 00:01:17,582 it or it simply just does not exist. 29 00:01:17,726 --> 00:01:20,878 Or somehow it does not exist in 30 00:01:20,904 --> 00:01:23,518 the right directory where you are. 31 00:01:23,664 --> 00:01:25,738 So first thing is how we could 32 00:01:25,764 --> 00:01:26,918 tell that the directory not exist. 33 00:01:26,954 --> 00:01:29,050 So let me log in to my machine. 34 00:01:29,910 --> 00:01:31,546 I have a machine right here. 35 00:01:31,668 --> 00:01:37,942 Now I am logged in as myself root sorry. 36 00:01:38,136 --> 00:01:41,150 I am in which directory? I do pwd. 37 00:01:41,210 --> 00:01:43,726 I am in slash root directory. Here, 38 00:01:43,788 --> 00:01:45,742 in this directory I will create a 39 00:01:45,756 --> 00:01:50,110 new directory, and I'll call it seinfeld. 40 00:01:50,110 --> 00:01:52,050 [No audio] 41 00:01:52,050 --> 00:01:57,110 Okay. So now when I do ls -ltr, I will see the directory. 42 00:01:57,170 --> 00:01:59,738 It is created with the name seinfeld. 43 00:01:59,894 --> 00:02:03,394 Now if I'm trying to cd into that 44 00:02:03,432 --> 00:02:09,274 directory Seinfeld, why am I getting this? 45 00:02:09,312 --> 00:02:10,922 No such file or directory. 46 00:02:11,066 --> 00:02:13,389 That is the most common issue 47 00:02:13,560 --> 00:02:17,002 people see and they get confused. Oh my God. Why? 48 00:02:17,076 --> 00:02:18,550 Where did the directory go? 49 00:02:18,660 --> 00:02:21,374 But you need to understand, relax 50 00:02:21,482 --> 00:02:23,434 and see what the problem is. 51 00:02:23,532 --> 00:02:30,238 If you notice, I typed uppercase S, whereas the 52 00:02:30,264 --> 00:02:33,406 directory that I created is with lowercase s. 53 00:02:33,528 --> 00:02:36,026 Now in Linux or Unix environment, 54 00:02:36,158 --> 00:02:38,686 uppercase and lowercase matters a lot. 55 00:02:38,808 --> 00:02:40,066 So keep that in mind. 56 00:02:40,188 --> 00:02:42,434 So the Seinfeld with uppercase 57 00:02:42,482 --> 00:02:43,886 directory does not exist. 58 00:02:44,018 --> 00:02:47,198 That is why you are having issues with logging 59 00:02:47,234 --> 00:02:50,594 in or cding into the system, into the directory. 60 00:02:50,642 --> 00:02:55,750 Now, next thing is absolute versus relative path. 61 00:02:56,370 --> 00:03:00,850 When you try to cd into a directory many 62 00:03:00,900 --> 00:03:03,898 times you have a path given and you put 63 00:03:03,924 --> 00:03:06,142 the path in but it doesn't work. 64 00:03:06,276 --> 00:03:10,334 Or you are trying to cd into through a relative path. 65 00:03:10,382 --> 00:03:13,690 You need to know where that folder is. 66 00:03:13,860 --> 00:03:16,462 Let's get into my Linux machine again. 67 00:03:16,536 --> 00:03:17,760 Let's clear the screen. 68 00:03:18,210 --> 00:03:22,538 So we do have a directory 69 00:03:22,574 --> 00:03:24,670 that we created which is seinfeld. 70 00:03:25,290 --> 00:03:28,850 Now I want to cd into this seinfeld directory. 71 00:03:28,910 --> 00:03:30,010 I'll hit enter. 72 00:03:30,180 --> 00:03:31,774 There's nothing in that directory because 73 00:03:31,812 --> 00:03:34,034 it's empty. In the seinfeld directory, 74 00:03:34,082 --> 00:03:37,090 I will create another directory called jerry, 75 00:03:37,590 --> 00:03:41,290 and I'll create another directory called kramer. 76 00:03:42,330 --> 00:03:44,566 So now inside of seinfeld, I 77 00:03:44,568 --> 00:03:47,318 have two directories jerry and kramer. 78 00:03:47,474 --> 00:03:52,450 And if I go into jerry directory and 79 00:03:52,500 --> 00:03:55,654 I'll do pwd you will see the entire 80 00:03:55,752 --> 00:04:01,382 path of this directory is root/seinfeld/jerry. 81 00:04:01,526 --> 00:04:04,258 So that is one of the things that you will 82 00:04:04,284 --> 00:04:06,842 experience when you try to cd into a directory, 83 00:04:06,926 --> 00:04:09,754 when you are missing a subfolder or sub 84 00:04:09,792 --> 00:04:13,790 directory in the absolute path. This entire path, 85 00:04:13,910 --> 00:04:15,766 if you're trying to cd into 86 00:04:15,828 --> 00:04:18,334 this entire path, it will work. 87 00:04:18,432 --> 00:04:19,450 It is going in. 88 00:04:19,500 --> 00:04:23,858 But if you are missing, let's say if you're 89 00:04:23,894 --> 00:04:28,574 missing one directory, let's say root and jerry. 90 00:04:28,682 --> 00:04:30,838 You know that you created jerry but you just 91 00:04:30,864 --> 00:04:33,982 couldn't keep track of where that directory go. 92 00:04:34,116 --> 00:04:36,890 You hit enter and say, No such file or directory. 93 00:04:36,950 --> 00:04:38,942 Now you are back to the equation 94 00:04:39,026 --> 00:04:40,354 one where we were talking 95 00:04:40,392 --> 00:04:42,010 about directory does not exist. 96 00:04:42,390 --> 00:04:43,526 You need to relax. 97 00:04:43,598 --> 00:04:46,790 You need to see where that directory was created. 98 00:04:46,910 --> 00:04:50,974 Anyway, so make sure your absolute path is 99 00:04:51,012 --> 00:04:54,746 correct. When you come to relative path, 100 00:04:54,878 --> 00:04:57,250 relative path is when you cd in 101 00:04:57,300 --> 00:05:00,982 let's say if I'm in cd slash, and then I 102 00:05:00,996 --> 00:05:05,270 do pwd, you will see I am in slash directory. 103 00:05:05,450 --> 00:05:08,938 I could go straight to jerry directory the way I 104 00:05:08,964 --> 00:05:14,076 did it before with a cd /root/seinfeld/jerry, 105 00:05:14,076 --> 00:05:16,270 and I will go straight into the directory. 106 00:05:16,830 --> 00:05:19,990 But if you cannot get in and you're trying to 107 00:05:20,040 --> 00:05:25,234 troubleshoot where that directory exists then I would recommend you 108 00:05:25,272 --> 00:05:27,430 that you go one step at a time. 109 00:05:27,540 --> 00:05:29,726 Like you are climbing up the stairs. 110 00:05:29,858 --> 00:05:33,334 Don't just try to jump three stairs up. 111 00:05:33,492 --> 00:05:35,566 Go one step at a time. 112 00:05:35,628 --> 00:05:40,150 So for that you will do cd /root. 113 00:05:40,950 --> 00:05:46,498 Now here, you need to do ls -l and see if there 114 00:05:46,584 --> 00:05:51,506 is a folder or a directory in the listing that says jerry. 115 00:05:51,698 --> 00:05:53,806 Does it? No right. 116 00:05:53,988 --> 00:05:55,906 So it means it's not there. 117 00:05:55,968 --> 00:05:59,878 So try to see where that directory is. 118 00:06:00,024 --> 00:06:02,918 Then you'll go into another folder 119 00:06:02,954 --> 00:06:04,620 that is called seinfeld. 120 00:06:05,610 --> 00:06:07,054 You are in the seinfeld. 121 00:06:07,092 --> 00:06:08,854 Do ls -l again. 122 00:06:09,012 --> 00:06:12,370 And now there it is, the directory called 123 00:06:12,420 --> 00:06:15,838 jerry or kramer wherever you want to go. 124 00:06:15,924 --> 00:06:17,690 And that's how you are ending 125 00:06:17,750 --> 00:06:20,150 up with the directory jerry. 126 00:06:20,330 --> 00:06:24,310 Another common mistake people make which is, going 127 00:06:24,360 --> 00:06:29,102 through the relative path but specifying absolute path. 128 00:06:29,246 --> 00:06:31,102 What does it mean? Let's check. 129 00:06:31,176 --> 00:06:35,182 So if I'm cd into slash, this is my main 130 00:06:35,182 --> 00:06:39,120 primary, the root very first directory of the system. 131 00:06:39,570 --> 00:06:44,318 Now I wanted to go into /root directory. 132 00:06:44,474 --> 00:06:46,922 Okay, I am in /root directory. 133 00:06:47,066 --> 00:06:50,846 It says I am in /root and I'll do ls minus 134 00:06:50,918 --> 00:06:54,914 l, and I do see that there is a directory called seinfeld. 135 00:06:55,022 --> 00:06:57,446 I try to cd into this directory. 136 00:06:57,578 --> 00:06:59,650 But many times the mistakes that people 137 00:06:59,700 --> 00:07:03,310 make is they do cd /seinfeld. 138 00:07:03,310 --> 00:07:06,190 [No audio] 139 00:07:06,190 --> 00:07:08,222 And when you hit enter, you get the 140 00:07:08,236 --> 00:07:10,434 same message, No such file or directory. 141 00:07:10,542 --> 00:07:11,666 Why is that? 142 00:07:11,848 --> 00:07:16,780 Because you are telling Linux operating system that this 143 00:07:17,170 --> 00:07:23,114 seinfeld is actually located at the root level, 144 00:07:23,212 --> 00:07:27,902 meaning at this level. It is not located at 145 00:07:27,916 --> 00:07:34,542 the root level, it is located under /root directory. 146 00:07:34,686 --> 00:07:37,718 So if you're going to specify slash then the 147 00:07:37,744 --> 00:07:40,526 system is going to think that you are trying 148 00:07:40,588 --> 00:07:45,114 to find that seinfeld directory in this /root. 149 00:07:45,222 --> 00:07:46,862 And when you do ls -l, 150 00:07:46,936 --> 00:07:49,180 you'll see there is no seinfeld. 151 00:07:49,570 --> 00:07:52,514 Make sure you need to know where you 152 00:07:52,552 --> 00:07:55,130 are using slash and where you are not. 153 00:07:55,240 --> 00:07:57,806 So that is why that's a common mistake people 154 00:07:57,868 --> 00:08:01,670 make when they do absolute path versus relative path. 155 00:08:02,170 --> 00:08:04,098 Next one we have permissions. 156 00:08:04,254 --> 00:08:07,202 Of course this is also very common when you 157 00:08:07,216 --> 00:08:10,838 are trying to cd into a directory and you 158 00:08:10,864 --> 00:08:13,686 cannot because you do not have permissions. 159 00:08:13,818 --> 00:08:16,360 Let me explain you permissions first. 160 00:08:16,360 --> 00:08:20,738 If you do not have quite a bit 161 00:08:20,764 --> 00:08:23,642 of understanding of permissions that is fine. 162 00:08:23,716 --> 00:08:24,854 I'm here to help you. 163 00:08:24,892 --> 00:08:25,862 So I'm going to explain to 164 00:08:25,876 --> 00:08:28,360 you the permission part in detail. 165 00:08:29,110 --> 00:08:31,298 The permission of a file or a 166 00:08:31,324 --> 00:08:34,974 directory is divided into three different groups. 167 00:08:35,142 --> 00:08:36,986 One that you see on the left 168 00:08:37,048 --> 00:08:39,808 hand side which has four bits. 169 00:08:39,929 --> 00:08:44,284 By the way, these dashes are referred as bits. 170 00:08:44,418 --> 00:08:47,953 Then this is a section which is divided for 171 00:08:47,991 --> 00:08:50,354 group, and this is a section for other. 172 00:08:50,511 --> 00:08:55,573 Now the first bit is actually the one 173 00:08:55,611 --> 00:08:58,070 that defines what type of file it is. 174 00:08:58,120 --> 00:09:01,338 Whether it is a file, it is a directory, it's 175 00:09:01,374 --> 00:09:06,434 a link, it's a socket file, anything, any type of 176 00:09:06,472 --> 00:09:11,934 file or what's the function of a file. 177 00:09:11,982 --> 00:09:14,670 It's all defined with the first attribute. 178 00:09:14,850 --> 00:09:17,258 If you see a d here on the 179 00:09:17,284 --> 00:09:19,910 first one then it means it's a directory. 180 00:09:20,290 --> 00:09:22,960 Then only then you could go in. 181 00:09:23,890 --> 00:09:26,680 Second bit is about read. 182 00:09:27,550 --> 00:09:31,118 So if you have read permission on 183 00:09:31,144 --> 00:09:34,886 the directory then can you get in? 184 00:09:35,068 --> 00:09:38,210 No read permission on a directory means 185 00:09:38,320 --> 00:09:40,082 you could still get in if you 186 00:09:40,096 --> 00:09:42,734 have executable but you cannot write anything. 187 00:09:42,892 --> 00:09:44,450 So this is the read. 188 00:09:44,620 --> 00:09:48,040 3rd bit is about the write, 189 00:09:48,430 --> 00:09:51,530 and the third one is about execute. 190 00:09:52,210 --> 00:09:57,374 Same way it goes for the first part that 191 00:09:57,412 --> 00:10:00,700 I just explained you is about the u. 192 00:10:01,270 --> 00:10:04,540 The second is for the group. 193 00:10:05,110 --> 00:10:07,754 The first one is u, meaning yourself, that 194 00:10:07,792 --> 00:10:12,030 you are the owner of that directory. 195 00:10:12,150 --> 00:10:15,962 Now don't confuse this you with the last o because a lot 196 00:10:15,976 --> 00:10:19,686 of people confuse u as user with o as the owner. 197 00:10:19,818 --> 00:10:22,442 Now o stands for others. Anyway, 198 00:10:22,516 --> 00:10:25,194 so second set of permissions 199 00:10:25,302 --> 00:10:27,822 again read, write, execute. 200 00:10:27,906 --> 00:10:29,666 Then the third one is for 201 00:10:29,728 --> 00:10:32,330 everyone else read, write, execute. 202 00:10:33,070 --> 00:10:35,546 These are the permissions about every 203 00:10:35,668 --> 00:10:37,034 file directory that we create. 204 00:10:37,072 --> 00:10:39,734 So let's go into our machine and you will 205 00:10:39,772 --> 00:10:46,266 see here I'm going to go into /root, ls -ltr 206 00:10:46,266 --> 00:10:48,006 to see my seinfeld directory. 207 00:10:48,078 --> 00:10:53,090 And you notice in the seinfeld directory we have these permissions. 208 00:10:54,090 --> 00:10:57,858 If you do not have d in front of 209 00:10:57,884 --> 00:11:00,094 a directory it means it's not a directory. 210 00:11:00,202 --> 00:11:02,802 No matter how many times you try to cd into it. 211 00:11:02,816 --> 00:11:03,920 It's not going to work. 212 00:11:04,970 --> 00:11:07,700 Then you're going to see is read, 213 00:11:08,630 --> 00:11:11,670 write, and execute, these three bits. 214 00:11:12,050 --> 00:11:18,030 It means the user whose root can 215 00:11:18,200 --> 00:11:22,234 have read and write and execute permission. 216 00:11:22,342 --> 00:11:24,634 When you say read, it means the user 217 00:11:24,682 --> 00:11:27,910 can read the content inside of the directory. 218 00:11:28,030 --> 00:11:31,350 When you have write, it means the user can 219 00:11:31,400 --> 00:11:35,590 actually write or create files inside of this folder. 220 00:11:35,710 --> 00:11:37,890 And when you have X, it means the 221 00:11:37,940 --> 00:11:41,494 user can actually go into the directory. 222 00:11:41,602 --> 00:11:43,194 Now this is very important. 223 00:11:43,352 --> 00:11:44,840 You need to know this. 224 00:11:45,770 --> 00:11:48,426 If you do not have this little bit right here 225 00:11:48,488 --> 00:11:52,378 execute, then you cannot cd into a directory. 226 00:11:52,414 --> 00:11:56,410 So make sure whichever group you are, whoever 227 00:11:56,470 --> 00:12:00,022 the user you are, you should have executable 228 00:12:00,106 --> 00:12:04,042 permissions to cd into the directory. 229 00:12:04,186 --> 00:12:09,690 Sometimes people confuse that with the read permission. 230 00:12:10,910 --> 00:12:13,434 Read and execute is not the same. 231 00:12:13,592 --> 00:12:18,814 Read allows you to cd into a directory whereas 232 00:12:18,982 --> 00:12:22,880 this r allows you to read the content. 233 00:12:23,390 --> 00:12:26,142 If you do not have r then 234 00:12:26,156 --> 00:12:27,874 you could still cd into a directory. 235 00:12:27,922 --> 00:12:30,137 But when you're going to run ls -l, 236 00:12:30,137 --> 00:12:31,158 it's going to say you don't have 237 00:12:31,184 --> 00:12:33,622 permission to view the content of the directory. 238 00:12:33,766 --> 00:12:34,710 So you got it. 239 00:12:34,820 --> 00:12:36,042 Hopefully you do. 240 00:12:36,236 --> 00:12:40,962 Then the second step is from here r dash x. 241 00:12:41,156 --> 00:12:44,286 This is for everybody else, meaning not, sorry, everybody. 242 00:12:44,348 --> 00:12:45,440 This is for group. 243 00:12:46,310 --> 00:12:47,842 Right now the user is root. 244 00:12:47,866 --> 00:12:48,934 The group is root. 245 00:12:49,042 --> 00:12:51,474 These are the two column who owns and 246 00:12:51,512 --> 00:12:54,654 who actually which group they are in. 247 00:12:54,752 --> 00:12:57,738 So the group permissions, you 248 00:12:57,764 --> 00:12:59,526 could actually read the content. 249 00:12:59,708 --> 00:13:02,598 You could cd into the directory but 250 00:13:02,684 --> 00:13:06,694 you cannot create any file or directory. 251 00:13:06,862 --> 00:13:09,390 The last one is the same for everyone else. 252 00:13:09,440 --> 00:13:11,298 You could read the content and 253 00:13:11,324 --> 00:13:13,954 you could cd into the directory. 254 00:13:14,122 --> 00:13:17,240 But you cannot create anything in it. 255 00:13:18,050 --> 00:13:21,238 So make sure you do not you have that permission. 256 00:13:21,274 --> 00:13:25,820 So if I'm going to take out the permission of others, 257 00:13:27,530 --> 00:13:28,947 of seinfeld, 258 00:13:28,947 --> 00:13:31,851 [No audio] 259 00:13:31,851 --> 00:13:35,580 so now what I'm saying is only root and 260 00:13:35,580 --> 00:13:38,990 its group can get into seinfeld, everybody else cannot. 261 00:13:39,170 --> 00:13:40,958 And you do ls -ltr you'll 262 00:13:40,994 --> 00:13:43,800 see that little x is gone. 263 00:13:44,610 --> 00:13:48,430 Now if I become myself, which is iafzal. 264 00:13:48,600 --> 00:13:53,150 Now if I try to go to root, Permission denied. 265 00:13:53,270 --> 00:13:56,698 Or even root doesn't have permission for me to come in. 266 00:13:56,844 --> 00:13:58,618 So let me go to slash and 267 00:13:58,644 --> 00:14:02,770 I'll do ls -ltr on root. 268 00:14:02,770 --> 00:14:05,890 [No audio] 269 00:14:05,890 --> 00:14:07,790 Where's root? Right here. 270 00:14:07,960 --> 00:14:11,090 You see, at the root level I'm not allowed to come in. 271 00:14:11,200 --> 00:14:13,010 Forget the seinfeld level. 272 00:14:13,180 --> 00:14:16,430 So make sure this executable exists. 273 00:14:17,770 --> 00:14:20,570 So let's go back as root. 274 00:14:20,570 --> 00:14:22,570 [No audio] 275 00:14:22,570 --> 00:14:25,910 So this time I'm going to give permission 276 00:14:25,910 --> 00:14:28,210 [No audio] 277 00:14:28,210 --> 00:14:34,110 for everyone to have, to cd into root. 278 00:14:35,656 --> 00:14:37,610 Now I'm in. Now, 279 00:14:38,670 --> 00:14:43,794 this one has a directory seinfeld, 280 00:14:43,902 --> 00:14:46,610 and I have taken out executable. 281 00:14:47,290 --> 00:14:49,850 Now I'm going to give it back the executable. 282 00:14:49,850 --> 00:14:52,310 [No audio] 283 00:14:52,310 --> 00:14:54,462 By the way, this is the command chmod. 284 00:14:54,536 --> 00:14:57,394 I am hoping, and I'm assuming everybody knows 285 00:14:57,502 --> 00:15:00,298 this is the command to assign or remove 286 00:15:00,334 --> 00:15:02,650 the permission of a file or directory. 287 00:15:02,830 --> 00:15:05,478 So now I'll do ls -ltr, and you 288 00:15:05,504 --> 00:15:08,982 see the permissions are granted to cd into it. 289 00:15:09,056 --> 00:15:10,894 I still cannot create any file. 290 00:15:11,002 --> 00:15:18,450 What if I remove r, chmod, others, remove r, seinfeld. 291 00:15:18,830 --> 00:15:21,114 So now when you do ls -ltr, you 292 00:15:21,152 --> 00:15:24,250 notice I do not have read permission. 293 00:15:24,430 --> 00:15:28,458 So now if I go into the seinfeld directory and you 294 00:15:28,484 --> 00:15:31,590 see I could view the content of jerry and kramer because 295 00:15:31,640 --> 00:15:36,198 I'm root, what if I become, iafzal, and now I 296 00:15:36,224 --> 00:15:43,258 go to cd into /root and I do ls -l. 297 00:15:43,414 --> 00:15:49,326 I cannot view the contents of root. Why? Because 298 00:15:49,508 --> 00:15:55,930 at the root level right here, right here no 299 00:15:55,980 --> 00:15:58,742 one other than root or it's group is allowed 300 00:15:58,766 --> 00:16:01,330 to come in, create or read the content. 301 00:16:01,500 --> 00:16:03,890 That's why you're getting the permission denied. 302 00:16:04,010 --> 00:16:06,730 Or you're saying cannot open directory. 303 00:16:07,710 --> 00:16:09,430 You could still cd into it. 304 00:16:09,480 --> 00:16:10,774 Why you could cd into it? 305 00:16:10,812 --> 00:16:14,414 Because we have given the executable 306 00:16:14,522 --> 00:16:16,140 if you remember, right here. 307 00:16:16,710 --> 00:16:18,628 Let's go cd slash, 308 00:16:18,628 --> 00:16:20,928 [No audio] 309 00:16:20,928 --> 00:16:22,370 where is root? 310 00:16:22,370 --> 00:16:25,610 [No audio] 311 00:16:25,610 --> 00:16:26,542 This is root. 312 00:16:26,626 --> 00:16:30,054 If you notice we have given the permission to come in. 313 00:16:30,212 --> 00:16:32,454 Anybody could come in to root but 314 00:16:32,552 --> 00:16:34,518 they cannot view the content because they 315 00:16:34,544 --> 00:16:37,626 don't have read permissions. Anyway, 316 00:16:37,688 --> 00:16:40,158 so that's another reason why you 317 00:16:40,184 --> 00:16:41,950 cannot cd into the directory. 318 00:16:42,070 --> 00:16:44,478 Next reason, file type. This is 319 00:16:44,504 --> 00:16:45,846 I already talked about it. 320 00:16:45,908 --> 00:16:49,374 If a file or directory does not have a d 321 00:16:49,412 --> 00:16:52,450 in front of it then it's not a file. 322 00:16:52,630 --> 00:16:54,598 Sorry, then it's not a directory. 323 00:16:54,754 --> 00:17:00,075 So if I am in my home directory, /home/iafzal, 324 00:17:00,075 --> 00:17:05,430 and I create a file called touch eliane. 325 00:17:06,530 --> 00:17:11,154 So if I try to do cd eliane, what will happen? 326 00:17:11,252 --> 00:17:13,290 It will say it's not a directory. Why? 327 00:17:13,339 --> 00:17:16,220 Because when you do ls -ltr, you'll see 328 00:17:16,550 --> 00:17:18,366 there is no d in front of it. 329 00:17:18,428 --> 00:17:20,394 So that's the file type I'm talking about. 330 00:17:20,432 --> 00:17:22,460 Make sure the file type is correct. 331 00:17:22,790 --> 00:17:25,198 The next one is parent directory permission. 332 00:17:25,233 --> 00:17:26,934 We have already covered that. 333 00:17:27,031 --> 00:17:30,858 When you do not have a correct permissions, let's say 334 00:17:30,884 --> 00:17:34,578 on the slash root, no matter how many permissions you have 335 00:17:34,723 --> 00:17:37,086 after the slash root, it does not matter. 336 00:17:37,208 --> 00:17:39,262 It's just the front main door is locked 337 00:17:39,286 --> 00:17:42,310 so you cannot go to the bedroom door. 338 00:17:42,490 --> 00:17:43,662 So that's why I make sure the 339 00:17:43,675 --> 00:17:45,622 parent directory has a proper permission. 340 00:17:45,766 --> 00:17:48,630 And the last one is the hidden directories. 341 00:17:49,250 --> 00:17:52,422 Many times people also make a 342 00:17:52,435 --> 00:17:54,406 mistake of a hidden directory. 343 00:17:54,478 --> 00:17:56,878 Meaning you create a file or directory. 344 00:17:56,914 --> 00:18:08,238 Let's say mkdir and I will make directory .simpsons, and I 345 00:18:08,264 --> 00:18:12,870 do ls -ltr, and you notice there is no simpson. 346 00:18:13,310 --> 00:18:15,694 But someone tells you hey, go to this directory 347 00:18:15,742 --> 00:18:18,258 and they actually miss out the dot because the 348 00:18:18,284 --> 00:18:21,082 dot is something that makes it hidden. 349 00:18:21,166 --> 00:18:22,438 So you will have to do ls 350 00:18:22,474 --> 00:18:26,130 minus la to show all hidden files. 351 00:18:26,510 --> 00:18:27,922 And in the hidden file you'll 352 00:18:27,946 --> 00:18:29,650 see there's a simpson directory. 353 00:18:29,770 --> 00:18:33,178 Now you could do into cd .simpson 354 00:18:33,334 --> 00:18:34,542 and then now you are in. 355 00:18:34,556 --> 00:18:36,030 So make sure the directory you're trying 356 00:18:36,080 --> 00:18:39,190 to come into is not hidden. 357 00:18:39,310 --> 00:18:41,850 So these are the few pointers I 358 00:18:41,900 --> 00:18:43,314 want you to keep in mind. 359 00:18:43,412 --> 00:18:46,400 If you go through every step of these 360 00:18:46,790 --> 00:18:51,138 troubleshooting, steps I'm pretty sure you will be 361 00:18:51,164 --> 00:18:52,765 able to resolve of your issue. 362 00:18:52,765 --> 00:18:53,973 [No audio]