1
00:00:04,370 --> 00:00:08,720
Let me start, guys, by explaining you Structure of Linux file system.

2
00:00:08,900 --> 00:00:15,020
Linux files and directories are located in a tree like structure at the root.

3
00:00:15,050 --> 00:00:19,700
There is a root directory that is represented simply by forward slash.

4
00:00:20,300 --> 00:00:27,920
Then this root directory has some subdirectories like bin as bin and so on.

5
00:00:28,160 --> 00:00:33,140
Those subdirectories may have own subdirectories and also files.

6
00:00:33,560 --> 00:00:41,270
It means that every directory could be considered as a branch of this tree and every file is a leaf.

7
00:00:41,510 --> 00:00:48,650
And again, all those branches and leaves start from root directory represented simply by forward slash.

8
00:00:48,770 --> 00:00:56,180
When any user logs into Linux system, he or she actually logs into own home directory.

9
00:00:56,180 --> 00:01:01,380
And the home directory of every user is represented by tilde sign.

10
00:01:01,410 --> 00:01:06,690
That's why we see the sign here after logging into Linux system.

11
00:01:06,990 --> 00:01:07,800
All right.

12
00:01:07,830 --> 00:01:14,460
Next, you could find the current directory you are currently in by entering the following command.

13
00:01:14,490 --> 00:01:15,000
P.

14
00:01:15,000 --> 00:01:15,720
W.

15
00:01:15,720 --> 00:01:16,020
D.

16
00:01:16,170 --> 00:01:19,050
That stands for print working directory.

17
00:01:19,080 --> 00:01:20,220
Let's press enter.

18
00:01:20,220 --> 00:01:24,630
And now I see that I am located in slash root folder.

19
00:01:24,840 --> 00:01:32,670
Please notice that absolute paths in Linux start from forward slash and here we see actually absolute

20
00:01:32,670 --> 00:01:35,790
path to a specific folder to a specific directory.

21
00:01:36,240 --> 00:01:45,270
If I go to other ubuntu virtual machine and type p w here, I will see that home folder for this.

22
00:01:45,270 --> 00:01:50,370
Bogdan user is different here and it is slash home slash Bogdan.

23
00:01:50,370 --> 00:01:57,690
And this path differs from this path and difference here appears because here we are logged in as root

24
00:01:57,690 --> 00:02:05,850
user into Linux docker container and in this case I'm logged in as regular user and home folders for

25
00:02:05,850 --> 00:02:11,520
all regular users are located in the home folder located in the root directory.

26
00:02:12,330 --> 00:02:14,100
All right, next command.

27
00:02:14,130 --> 00:02:22,110
You are able to CD to root of the file system in Linux computer using following command CD and forward

28
00:02:22,110 --> 00:02:28,320
slash forward slash represents root directory in any Linux operating system.

29
00:02:28,440 --> 00:02:34,800
Let's see DB2 root directory and notice that the command prompt here was changed and now see forward

30
00:02:34,800 --> 00:02:36,930
slash instead of tilde sign.

31
00:02:36,930 --> 00:02:44,310
And if I type p.w.d. here now I'll see that now I'm located in root directory.

32
00:02:44,670 --> 00:02:52,280
You could always go back to your home directory for your logged in user by entering simply CD like this.

33
00:02:52,290 --> 00:02:59,670
And now I'm back into home directory and if I type PWD, I see path to my home directory.

34
00:02:59,670 --> 00:03:02,460
For this root user it is simply slash root.

35
00:03:03,350 --> 00:03:04,090
All right.

36
00:03:04,100 --> 00:03:11,030
That's how you could change directory and move either to home folder or to root folder.

37
00:03:11,570 --> 00:03:15,500
Next, let me demonstrate you how you could move into specific folder.

38
00:03:15,680 --> 00:03:22,970
For example, if I list the files and folders here in home folder for this root user, I will see actually

39
00:03:22,970 --> 00:03:23,810
empty list.

40
00:03:23,810 --> 00:03:29,390
And that means that there are no files and folders inside of the home directory for this user.

41
00:03:29,390 --> 00:03:39,140
And if I go to root folder like so and list files and folders here, I'll see such folders as home media

42
00:03:39,140 --> 00:03:40,020
and so on.

43
00:03:40,040 --> 00:03:45,740
If you want to go into specific folder, for example, let's go into run folder.

44
00:03:45,740 --> 00:03:51,320
You could type, CD and type I is a relative path or absolute path.

45
00:03:51,830 --> 00:03:56,390
If you are already located in specific folder, you could use relative path.

46
00:03:56,390 --> 00:04:00,290
And in this case I could simply type run like so.

47
00:04:00,410 --> 00:04:07,920
And now I'm inside of the run folder and if I enter P.w.d. now I will see that now I'm inside of the

48
00:04:07,920 --> 00:04:16,589
slash run folder and this path that starts with forward slash is absolute path and you are always able

49
00:04:16,589 --> 00:04:21,180
to go into specific folder using absolute path to this folder.

50
00:04:21,540 --> 00:04:22,680
Let me show you that.

51
00:04:22,680 --> 00:04:30,330
For example, let's list folders here and let's CD into mount folder like So here again I'm using relative

52
00:04:30,330 --> 00:04:37,980
path and now here if I'll enter CD forward slash boot, I'll go into the boot folder located in the

53
00:04:37,980 --> 00:04:42,300
root directory enter and now I'm inside of the boot folder.

54
00:04:42,480 --> 00:04:45,570
That's because I have just used absolute path.

55
00:04:45,780 --> 00:04:46,530
All right.

56
00:04:46,530 --> 00:04:52,560
That's how you could move into specific folder using relative path or absolute path.

57
00:04:52,710 --> 00:04:56,850
Also, let me show you now what is the meaning of dot and two dots here.

58
00:04:56,850 --> 00:05:04,830
When you use CD command, If I type simply CD and dot, nothing will change because Dot represents current

59
00:05:04,830 --> 00:05:06,080
working directory.

60
00:05:06,090 --> 00:05:09,810
This directory CD in this case slash boot.

61
00:05:10,570 --> 00:05:17,620
But if I type CD and two dots, I will go one level up to the parent directory and in this case I will

62
00:05:17,620 --> 00:05:24,910
go to root directory CD two dots, and now I'm inside of the root directory represented by Slash.

63
00:05:25,630 --> 00:05:26,260
All right.

64
00:05:26,260 --> 00:05:32,150
Let me now show you how to use Tab in order to autocomplete names of the directories and files.

65
00:05:32,170 --> 00:05:39,490
If I type here, CD slash and press tab twice, I'll see all possible directories and files that are

66
00:05:39,490 --> 00:05:41,260
located in the root folder.

67
00:05:41,260 --> 00:05:49,030
And if I type for example M and press tab twice, I'll see all possible directories and files that start

68
00:05:49,030 --> 00:05:49,990
with M.

69
00:05:50,320 --> 00:05:57,940
If I add additional letter here and press tab only single time, I'll see that this folder name will

70
00:05:57,940 --> 00:05:59,770
be autocompleted to media.

71
00:05:59,800 --> 00:06:03,550
That's because now there is just a single option that starts with M.

72
00:06:04,120 --> 00:06:04,900
All right.

73
00:06:04,900 --> 00:06:10,270
If I press tab twice now at this moment of time I see actually empty list.

74
00:06:10,270 --> 00:06:15,430
And that means that the media directory does not have any subdirectories.

75
00:06:15,940 --> 00:06:25,760
Let me remove media from here and let's go into folder like so and if I press tab now twice I see all

76
00:06:25,760 --> 00:06:31,750
possible options of file names and directories that I could use after e.t.c..

77
00:06:32,000 --> 00:06:36,020
And for example, here I see as l folder.

78
00:06:36,020 --> 00:06:44,420
And if I type here esky and press tab, I'll see that the directory name will be autocompleted to L

79
00:06:44,450 --> 00:06:46,010
if I press tab.

80
00:06:46,010 --> 00:06:55,790
Now here I see that there are only files called dot bash log out, dot bash RC and dot profile and there

81
00:06:55,790 --> 00:07:00,200
are no subdirectories inside of the SRC directory.

82
00:07:00,410 --> 00:07:05,420
All right, let's suppose that I want to go into this directory for this.

83
00:07:05,420 --> 00:07:11,970
I'll remove this last dot that was autocompleted and press enter here and now I'm inside of the src

84
00:07:12,530 --> 00:07:13,220
directory.

85
00:07:13,220 --> 00:07:20,210
Let me clear terminal and if I enter PWD, I will see this absolute path that starts always with forward

86
00:07:20,210 --> 00:07:20,900
slash.

87
00:07:21,440 --> 00:07:22,160
All right.

88
00:07:22,160 --> 00:07:28,670
If I want to go out from this SRC folder, I could simply type CD and two dots.

89
00:07:28,700 --> 00:07:32,000
It will go one level up to directory.

90
00:07:32,450 --> 00:07:36,830
Let me go back to CD here.

91
00:07:36,830 --> 00:07:43,430
I could use relative path because I'm already located in directory and press enter here and let's suppose

92
00:07:43,430 --> 00:07:49,040
that I want now to go to another sub directory of directory.

93
00:07:49,040 --> 00:07:56,840
For that I could simply type CD two dot, then forward slash and if I press tab twice here at this moment

94
00:07:56,840 --> 00:08:02,630
I will see all possible directories and files inside of the folder.

95
00:08:02,750 --> 00:08:07,310
And for example, let's go to dpkg directory.

96
00:08:07,310 --> 00:08:10,970
Let's start typing d p press tab.

97
00:08:10,970 --> 00:08:12,560
Yes it was autocompleted.

98
00:08:12,560 --> 00:08:20,480
Let's press tab twice here and I see that this dpkg directory contains origins sub directory.

99
00:08:20,480 --> 00:08:21,800
Let's go into it.

100
00:08:21,830 --> 00:08:23,990
I could type simply o and press tab.

101
00:08:23,990 --> 00:08:29,840
It will be autocompleted and let's press tab twice here and I see several files.

102
00:08:29,870 --> 00:08:33,980
Notice that at the end of every directory there will be forward slash.

103
00:08:33,980 --> 00:08:38,299
And that's how I recognize that this is directory and this is also directory.

104
00:08:38,299 --> 00:08:39,710
But this is file.

105
00:08:39,799 --> 00:08:47,390
And now I see that this origins directory contains only three files Debian default and ubuntu.

106
00:08:47,960 --> 00:08:49,670
All right, let's press enter.

107
00:08:49,670 --> 00:08:52,910
And now I'm inside of the origins directory.

108
00:08:52,910 --> 00:08:59,510
That's how you could use two dots in order to go into parent folder and go into some sub folders of

109
00:08:59,510 --> 00:09:00,890
that parent folder.

110
00:09:01,190 --> 00:09:01,820
Great.

111
00:09:01,820 --> 00:09:08,650
Let me type simply CD and I have returned back to my home directory and type CD.

112
00:09:08,810 --> 00:09:13,040
I'll see that now I'm again inside of the slash root folder.

113
00:09:13,040 --> 00:09:20,270
And again this directory is a home directory for root user and please notice that there is difference

114
00:09:20,270 --> 00:09:24,620
between slash root directory and simply slash directory.

115
00:09:24,830 --> 00:09:30,080
Slash directory is a root directory for all files and folders in Linux.

116
00:09:30,110 --> 00:09:37,700
It is a root of file system in Linux, but slash root is sub folder that is located in the root of file

117
00:09:37,700 --> 00:09:43,040
system in Linux and it represents home directory for root user.

118
00:09:43,340 --> 00:09:44,810
Please keep in mind that.

119
00:09:45,020 --> 00:09:49,280
All right, that's all what I wanted to explain you here in this lecture and now you understand what

120
00:09:49,280 --> 00:09:55,670
is the difference between root directory, absolute path and relative path and how to locate the current

121
00:09:55,670 --> 00:09:57,320
directory you are currently in.

122
00:09:57,410 --> 00:09:58,670
That's all for this lecture.

123
00:09:58,670 --> 00:10:04,210
And next, let me explain you how to manage files, how to create new files and how to list files.

124
00:10:04,220 --> 00:10:05,540
I'll see you in the next lecture.

125
00:10:05,540 --> 00:10:05,990
Bye bye.

