1 00:00:00,000 --> 00:00:01,319 [No audio] 2 00:00:01,319 --> 00:00:03,179 In this lesson, we're going to cover the directory 3 00:00:03,179 --> 00:00:09,179 listing attributes. When you do ls within a 4 00:00:09,179 --> 00:00:12,569 directory, so you cd into a directory and you do 5 00:00:12,599 --> 00:00:16,588 ls, and you're going to only see the directories 6 00:00:16,619 --> 00:00:20,429 inside, but when you do ls -l, or ltr, 7 00:00:20,429 --> 00:00:25,409 other options within that ls command, you're 8 00:00:25,409 --> 00:00:28,379 going to see different fields that's going to 9 00:00:28,469 --> 00:00:32,668 output on your screen. The first field is the Type 10 00:00:33,058 --> 00:00:39,089 of the file. So if any file that begins with d, it is 11 00:00:39,119 --> 00:00:42,839 a directory, any file that begins with l, it's a 12 00:00:42,839 --> 00:00:46,379 link, and any file that does not have anything on 13 00:00:46,379 --> 00:00:49,859 it, it's just a regular file. So the first field 14 00:00:49,859 --> 00:00:52,829 tells you about the Type. The second field tells 15 00:00:52,829 --> 00:00:55,709 you about the number of Links it has, or hard links 16 00:00:55,709 --> 00:00:59,189 that are attached to that directory. The third one, it 17 00:00:59,189 --> 00:01:02,159 tells you, the Owner of the directory, who owns it. 18 00:01:03,629 --> 00:01:07,949 The the fourth, the fourth one tells you the Group 19 00:01:08,099 --> 00:01:11,819 of the directory, which group owns the directory, 20 00:01:12,449 --> 00:01:16,289 and then the Size of the directory or file, the 21 00:01:16,289 --> 00:01:22,889 Month, the Day, the Time, and the Name. So these 22 00:01:22,889 --> 00:01:25,829 are the basic attributes when you do ls -l. 23 00:01:26,249 --> 00:01:30,059 So let's go to our Linux server and see how it 24 00:01:30,059 --> 00:01:31,889 looks in our Linux server. 25 00:01:31,889 --> 00:01:39,210 [No audio] 26 00:01:39,210 --> 00:01:46,500 Right click, Open Terminal. Okay. Which directory 27 00:01:46,500 --> 00:01:49,980 are you in? Let's do pwd, and I am in my 28 00:01:49,980 --> 00:01:52,800 directory. So let's go to slash home directory. 29 00:01:53,850 --> 00:01:56,670 Sorry, slash, just slash directory, which is the 30 00:01:56,670 --> 00:01:59,730 parent directory, and then we will do ls -l. 31 00:02:00,780 --> 00:02:03,210 Here you will see the first again, the first 32 00:02:04,140 --> 00:02:06,720 column right here tells you what type of file it 33 00:02:06,720 --> 00:02:11,280 is. Second one, how many links, owner, group 34 00:02:11,280 --> 00:02:17,850 owner, the size, the month, date, time, and the 35 00:02:17,850 --> 00:02:21,270 name. So this is what you should need to know 36 00:02:21,510 --> 00:02:24,960 whenever you're doing ls, because if you are trying 37 00:02:24,960 --> 00:02:28,710 to do cd to a file, let's say we have this file, 38 00:02:30,480 --> 00:02:35,190 testfile. If you do test, if you trying to get 39 00:02:35,190 --> 00:02:39,300 into this file, it will tell you it's not a 40 00:02:39,300 --> 00:02:42,780 directory because it's a file. That's how you 41 00:02:42,780 --> 00:02:46,140 should know whether you are able to get into a 42 00:02:46,140 --> 00:02:50,250 file or not. So if you go into let's say cd, slash 43 00:02:50,250 --> 00:02:54,810 usr, there you go. You are in slash usr 44 00:02:54,810 --> 00:02:59,760 directory because it's a directory. So that's how 45 00:02:59,760 --> 00:03:03,810 you find out whether a file is a directory or link 46 00:03:04,320 --> 00:03:05,610 or just a regular file. 47 00:03:05,610 --> 00:03:07,072 [No audio]