1
00:00:04,300 --> 00:00:09,100
We have just discussed what is the difference between absolute path and relative path in Linux?

2
00:00:09,100 --> 00:00:14,290
And you know, that Slash is simply a root directory in Linux computer.

3
00:00:14,440 --> 00:00:22,270
Also, you know that when a user logs into Linux shell either locally or remotely, he or she logs basically

4
00:00:22,270 --> 00:00:29,550
into home directory and by default you will see this tilde sign in command prompt and if you enter w

5
00:00:29,800 --> 00:00:36,970
you could find location of your home directory and location of home directory for this root user is

6
00:00:36,970 --> 00:00:38,250
simply slash root.

7
00:00:38,260 --> 00:00:39,550
It is absolute path.

8
00:00:39,730 --> 00:00:46,330
All right, now let me go to root directory by typing CD and slash and you see that the command prompt

9
00:00:46,330 --> 00:00:54,250
was changed and let me use here command ls that will list all directories and files inside of the root

10
00:00:54,250 --> 00:00:54,970
folder.

11
00:00:55,060 --> 00:00:59,740
Let's press enter and here you'll see some directories and files.

12
00:00:59,740 --> 00:01:06,230
And please notice that those names have different colors and if for some name doesn't have any color,

13
00:01:06,230 --> 00:01:09,860
it means that it is a regular file like hello dot txt.

14
00:01:10,160 --> 00:01:13,490
I have created this file in one of the previous lectures.

15
00:01:13,520 --> 00:01:22,550
Same relates to this file and this file directories are colored in blue color like proc run, serve

16
00:01:22,760 --> 00:01:29,720
and cis and in light blue color like Lipa or sbin Linux colors Linux.

17
00:01:29,720 --> 00:01:33,620
And there are two types of Linux soft links and hard Linux.

18
00:01:34,070 --> 00:01:36,080
I'll explain what is link a bit later.

19
00:01:36,320 --> 00:01:45,170
If you want to see the details about every directory or file, you could add additional option ls l.

20
00:01:45,170 --> 00:01:51,080
And with this option you'll see actually a table that contains a bunch of additional information in

21
00:01:51,080 --> 00:01:51,730
this table.

22
00:01:51,740 --> 00:01:53,860
First, you see permissions.

23
00:01:53,870 --> 00:01:57,140
Here is permission, here is permission and so on.

24
00:01:57,770 --> 00:02:03,170
Next you see quantity of links to specific directory or file.

25
00:02:03,470 --> 00:02:09,889
Next comes username, next group name afterwards size in bytes.

26
00:02:09,889 --> 00:02:11,690
For example, here you see size.

27
00:02:11,690 --> 00:02:16,210
That is 4096 bytes around four kilobytes.

28
00:02:16,220 --> 00:02:21,380
Next date when directory of file was created or modified.

29
00:02:21,380 --> 00:02:29,510
And finally, name and colours in this output are the same as you see when you don't use this option.

30
00:02:29,510 --> 00:02:35,780
And please notice that for Linux that are colored using light blue color like this one or this one,

31
00:02:35,780 --> 00:02:44,030
you'll see actual link and it means that for example lib 64 simply points to another directory user

32
00:02:44,030 --> 00:02:49,340
lib 64 and the lib points to user slash lib.

33
00:02:49,610 --> 00:02:54,950
All right, let me now explain you in details what those permissions here mean.

34
00:02:55,070 --> 00:03:04,070
First, let's have a look at first character d l or dash if it is a file like hello dot txt or std r

35
00:03:04,070 --> 00:03:07,910
dot txt then first character will be simply dash.

36
00:03:07,910 --> 00:03:12,650
Here you see dash here you see dash and here you see also same sign.

37
00:03:12,950 --> 00:03:15,080
Next for directories.

38
00:03:15,110 --> 00:03:22,580
First character will be d like in this example home directory or in this example media directory and

39
00:03:22,580 --> 00:03:23,210
so on.

40
00:03:23,450 --> 00:03:30,110
And Linux will start with L character like in this example, this one or this one.

41
00:03:31,040 --> 00:03:39,020
Next, you see permissions for a specific file or directory, and they are grouped into three different

42
00:03:39,020 --> 00:03:39,620
groups.

43
00:03:39,650 --> 00:03:41,060
Here is the first group.

44
00:03:41,060 --> 00:03:43,820
Here is the second group, and here is the third group.

45
00:03:44,400 --> 00:03:50,220
Those are permissions for user read, write and execute.

46
00:03:51,100 --> 00:03:54,340
Next come permissions for group.

47
00:03:54,760 --> 00:04:00,460
Group is in second column and if a user wasn't assigned to a specific group, then group name will be

48
00:04:00,460 --> 00:04:01,780
the same as username.

49
00:04:01,780 --> 00:04:03,100
That's what we see here.

50
00:04:03,610 --> 00:04:11,860
Read, write and execute for group users and read, write and execute for all other users that don't

51
00:04:11,860 --> 00:04:13,690
belong to this specific group.

52
00:04:14,400 --> 00:04:17,290
For example, let's have a look at this line.

53
00:04:17,310 --> 00:04:24,540
In this case, user root user is able to read, write and execute this directory.

54
00:04:24,570 --> 00:04:25,050
Opt.

55
00:04:26,120 --> 00:04:30,260
Group users are able only to read this directory.

56
00:04:30,290 --> 00:04:34,310
They are not able to write, but they are able to execute.

57
00:04:35,010 --> 00:04:37,830
And same for all remaining users.

58
00:04:38,010 --> 00:04:42,060
They are able to read, not able to write and are able to execute.

59
00:04:42,750 --> 00:04:49,030
If I have a look at this line, it is actually root directory that is a home directory for root user.

60
00:04:49,050 --> 00:04:56,160
Here I see that this directory could be read, written and executed only by user.

61
00:04:56,190 --> 00:05:03,820
There are no permissions for other users in the same group or for other users from other groups here.

62
00:05:03,840 --> 00:05:05,850
Everywhere you see dashes.

63
00:05:06,600 --> 00:05:11,880
Let's have a look at those permissions for this std error dot txt file.

64
00:05:12,000 --> 00:05:13,080
It is a file.

65
00:05:13,080 --> 00:05:14,640
It starts with the dash.

66
00:05:14,670 --> 00:05:19,650
Next here you see user permissions read, write and not execute.

67
00:05:20,490 --> 00:05:24,510
Are the users in the same group are able only to read this file?

68
00:05:24,540 --> 00:05:30,960
They are not able to change it or execute and remaining users in other groups are also able only to

69
00:05:30,960 --> 00:05:32,010
read this file.

70
00:05:33,270 --> 00:05:39,930
I'll explain you how to make file executable a bit later when I'll tell you how to create your own shell

71
00:05:39,930 --> 00:05:40,710
scripts.

72
00:05:40,710 --> 00:05:46,680
And if you want to execute a specific shell script, you need to make such file executable.

73
00:05:46,680 --> 00:05:48,390
You need to change its permissions.

74
00:05:48,390 --> 00:05:50,220
We will get back to it a bit later.

75
00:05:50,340 --> 00:05:51,090
All right.

76
00:05:51,090 --> 00:05:57,180
That's all for file permissions and that's how you are able to distinguish between directories, links

77
00:05:57,180 --> 00:05:58,380
and files.

78
00:05:58,950 --> 00:05:59,730
All right.

79
00:05:59,730 --> 00:06:08,090
Next, let me explain you how you could see file size of every directory or file in human readable format.

80
00:06:08,100 --> 00:06:10,200
For that, you could use another option.

81
00:06:10,200 --> 00:06:14,520
Let's type ls l h h stands for human.

82
00:06:14,520 --> 00:06:15,540
Let's press enter.

83
00:06:15,540 --> 00:06:20,010
And now I see those sizes in kilobytes, megabytes and so on.

84
00:06:20,010 --> 00:06:23,940
Actually, in this case I see only sizes in kilobytes.

85
00:06:23,940 --> 00:06:28,620
But let me for example go into bin folder and enter same command there.

86
00:06:28,650 --> 00:06:32,070
CD bin and ls l h.

87
00:06:32,880 --> 00:06:35,370
And now I see some sizes in kilobytes.

88
00:06:35,370 --> 00:06:36,660
56kB.

89
00:06:36,660 --> 00:06:38,250
35kB.

90
00:06:38,580 --> 00:06:40,890
Probably there are some larger files.

91
00:06:40,890 --> 00:06:43,140
Let me go a bit up.

92
00:06:43,170 --> 00:06:43,590
Yeah.

93
00:06:43,590 --> 00:06:45,380
Here is an example of such file.

94
00:06:45,390 --> 00:06:49,860
This file is 3.4MB in size.

95
00:06:49,890 --> 00:06:56,370
Also a bit later I'll explain you how you could filter files by file size and how you could sort files

96
00:06:56,370 --> 00:06:57,420
in this output.

97
00:06:57,720 --> 00:07:00,690
Also, I want to show you how to use one more option.

98
00:07:00,690 --> 00:07:04,770
Let me clear terminal and go back to root directory.

99
00:07:04,770 --> 00:07:13,410
And here let me type LS dash capital F With this option you'll see actually types of all files and directories.

100
00:07:13,410 --> 00:07:16,470
And this ad means that it is a link.

101
00:07:16,620 --> 00:07:23,610
This forward slash means that here you see directory and if you don't have any forward slash or ad at

102
00:07:23,610 --> 00:07:28,470
the end of the name, then it means that it is simply a regular file like hello dot txt.

103
00:07:29,720 --> 00:07:37,360
This output is useful when you want to write this output, for example, to a specific file and inside

104
00:07:37,360 --> 00:07:41,460
of the file you will not see any colors like blue color, light blue and so on.

105
00:07:41,480 --> 00:07:42,860
Let me show you that quickly.

106
00:07:42,890 --> 00:07:46,970
For example, I could write this output into specific file.

107
00:07:46,970 --> 00:07:49,340
Let's say test dot txt.

108
00:07:50,250 --> 00:07:57,270
And if I'll read the contents of this file called Test.txt, I'll see actually the same characters at

109
00:07:57,270 --> 00:07:58,950
the end of every name.

110
00:07:58,950 --> 00:08:06,060
But of course, I don't see any colors because the text files store characters simply in C or other

111
00:08:06,060 --> 00:08:06,630
format.

112
00:08:06,660 --> 00:08:08,730
They don't store any colors at all.

113
00:08:08,760 --> 00:08:09,510
All right.

114
00:08:09,510 --> 00:08:10,620
Let me clear our terminal.

115
00:08:10,620 --> 00:08:13,190
And now let me show you another option.

116
00:08:13,710 --> 00:08:16,440
Dash LA with a option.

117
00:08:16,440 --> 00:08:20,340
You could also see hidden files and folders.

118
00:08:20,340 --> 00:08:25,770
And for example, here is hidden file, hidden files and folders in Linux.

119
00:08:25,770 --> 00:08:27,810
Start always with dot.

120
00:08:28,380 --> 00:08:31,740
If I simply enter ls l.

121
00:08:31,770 --> 00:08:37,409
I don't see this file here in this output, but with a option.

122
00:08:37,409 --> 00:08:40,520
I see such files and folders on the list.

123
00:08:40,530 --> 00:08:43,440
In this case there is a single hidden file.

124
00:08:43,650 --> 00:08:51,120
If I go to etsy folder and list all files and folders including hidden files and folders here, scroll

125
00:08:51,120 --> 00:08:51,660
up.

126
00:08:53,410 --> 00:08:55,330
And at the beginning of this output I see.

127
00:08:55,360 --> 00:08:58,630
Hidden file dot p.w.d. dot log.

128
00:08:58,960 --> 00:09:04,390
Again, without this option you will not see hidden directories and files.

129
00:09:04,420 --> 00:09:05,080
All right.

130
00:09:05,080 --> 00:09:08,140
That's all what I wanted to demonstrate you here in this lecture.

131
00:09:08,140 --> 00:09:12,820
And now you know how to distinguish between directories, files and links.

132
00:09:12,820 --> 00:09:15,940
They have different colors, at least in Bash Shell.

133
00:09:15,970 --> 00:09:21,250
Also, you know how to use such options as L A and H.

134
00:09:21,280 --> 00:09:28,510
With H option, you could find human readable sizes for all directories and files you are looking at.

135
00:09:28,750 --> 00:09:29,920
That's all for this lecture.

136
00:09:29,920 --> 00:09:33,810
And next, let me explain you how to create new files and folders.

137
00:09:33,820 --> 00:09:34,660
I'll see you next.

138
00:09:34,660 --> 00:09:35,260
Bye bye.

