WEBVTT

00:00.350 --> 00:03.410
Hello, my name is Typhoon and welcome to another lecture of our course.

00:03.440 --> 00:08.990
In this lecture of our course, you will learn about the traversing directories and you will use the

00:08.990 --> 00:10.760
absolute directories for references.

00:10.760 --> 00:12.110
So let's get started.

00:26.260 --> 00:32.920
So you can you change the directory to move your shell session to another directory in the Linux file

00:32.920 --> 00:33.400
system?

00:33.400 --> 00:37.450
So this CD command, this syntax is pretty simple.

00:37.450 --> 00:43.960
So you first enter the CD, which means change directory, and after that you enter the destination

00:43.960 --> 00:44.320
here.

00:44.320 --> 00:48.220
So the CD command may take a single argument as a destination here.

00:48.220 --> 00:51.670
So you will enter destination here.

00:51.670 --> 00:55.810
So which this destination specifies a directory you want to go.

00:56.020 --> 01:02.350
So if you don't specify a destination on the CD command, it takes you to your home directory here.

01:02.350 --> 01:10.000
So if you make it like that, CD downloads and after that CD and as you can see here we go to Home Directory

01:10.000 --> 01:10.630
again.

01:10.630 --> 01:17.860
So you will in this chapter you will learn the um, each of these methods and you will learn about the

01:17.860 --> 01:24.640
differences between these two methods are important to understand as you traverse the file system so

01:24.640 --> 01:31.220
you can reference a directory name with within the virtual directory system using the absolute directory

01:31.220 --> 01:31.730
reference.

01:31.730 --> 01:37.070
So the absolute directory reference defines exactly where the directory is in the virtual directory

01:37.070 --> 01:39.080
structure and starting at the root.

01:39.080 --> 01:44.120
So think of the absolute directory reference as the full name for the directory.

01:44.150 --> 01:52.190
So an absolute directory reference always begins with a forward slash indicating the virtual directory

01:52.190 --> 01:53.450
system's root.

01:53.450 --> 02:01.040
So fuse to reference user binaries contained within the user directories.

02:01.310 --> 02:08.120
Bind bind some directory here so you you will use so user here and here you can.

02:08.420 --> 02:12.860
As you can see whenever I click to the tab here, oops, here.

02:12.950 --> 02:20.570
So whenever I click the tab button on my keyboard it will show make.

02:21.320 --> 02:24.950
Uh, possible inputs for my command here.

02:24.950 --> 02:29.330
So in this case, we will enter the bin here so usr bin.

02:29.330 --> 02:32.600
And as you can see, we changed our directory to usr bin.

02:32.600 --> 02:36.470
So there's no w as to exactly where you want to go.

02:36.470 --> 02:41.990
So to move to a specific location on the file system using the absolute directory or reference, you

02:41.990 --> 02:46.250
just specify the path name in the C command.

02:46.250 --> 02:47.780
So we can also do like that.

02:47.780 --> 02:49.460
For example, let's make it go to home.

02:49.460 --> 02:55.220
And as you can see, we are in the home and let's go to user bin user.

02:56.530 --> 02:57.490
USR bin.

02:59.580 --> 03:03.990
And as you can see here, we changed our directory to usr bin here.

03:04.830 --> 03:14.280
Also, did you notice that the this example that the prompt originally had a title here, had a title

03:14.280 --> 03:21.270
in it, and after that change to Native Directory occurred, the title was replaced by being here.

03:21.270 --> 03:22.310
As you can see here.

03:22.320 --> 03:28.860
Firstly, we had a title here, but whenever we clicked and changed the directory there, we showed

03:28.860 --> 03:30.470
us that we are you.

03:30.510 --> 03:34.920
We are at a different directory other than our home directory here.

03:34.920 --> 03:40.680
So this is where the command line interface prompt can help you keep track of where you are in the virtual

03:40.680 --> 03:41.730
directory structure.

03:41.730 --> 03:47.970
So the tiled indicates that your cell session is located in your home directory.

03:47.970 --> 03:48.750
Like this, for example.

03:48.750 --> 03:52.710
Let's go to home and as you can see, we are in the home now.

03:53.570 --> 04:00.530
So after you move out of your home directory, the partial directory reference is shown in the prompt.

04:00.530 --> 04:03.220
So if the prompt has been configured to do so.

04:03.230 --> 04:10.100
So if your prompt has not been configured to show the shell session current absolute directory location,

04:10.100 --> 04:13.970
then you can display the location via a shell command.

04:14.000 --> 04:22.450
The WD command displays the shell session's current directory location, which is called the present

04:22.460 --> 04:22.760
actual.

04:22.760 --> 04:24.380
Let me write it right here.

04:24.380 --> 04:25.160
So.

04:26.330 --> 04:28.880
So this called present.

04:33.140 --> 04:34.220
Working.

04:39.070 --> 04:39.910
Directory.

04:46.970 --> 04:47.360
Here.

04:47.360 --> 04:52.580
As you can see, p w d means that present working directory.

04:52.580 --> 05:02.180
So if you write the D here and as you can see, we printed us the our working directory in our shell

05:02.180 --> 05:02.390
here.

05:02.390 --> 05:14.450
So if we go to user bin CD user bin or again CD bin here and whenever we write the p w d present working

05:14.450 --> 05:14.870
directory.

05:14.870 --> 05:18.260
And as you can see here, we printed our current working directory.

05:18.260 --> 05:23.600
As you can see, these are not the same because we changed our working directory.

05:24.110 --> 05:30.530
So you can move to any level within the entire Linux virtual directory structure from any level.

05:30.530 --> 05:39.140
Using the absolute directory reference, we can also go to, for example, CD actual let's clear the,

05:39.140 --> 05:41.720
we can also go to CD var log here.

05:41.720 --> 05:44.840
And as you can see here, we got to var log.

05:44.840 --> 05:52.650
So this changed here and whenever we write the CD and as you can see here, we are seeing our working

05:52.650 --> 05:53.400
directory now.

05:53.400 --> 05:58.950
So you can also quickly jump to your home directory from any level within the Linux virtual directory

05:58.950 --> 06:01.470
structure with just a simple CD command.

06:01.470 --> 06:05.100
And as you can see here we are in the home now.

06:05.100 --> 06:11.040
However, if you are just working with your own home directory structure, often using the absolute

06:11.040 --> 06:13.290
directory references can get tedious.

06:13.290 --> 06:20.700
So for example, if you are already in the directory of our home column, it seems somewhat cumbersome

06:20.700 --> 06:22.920
to have to type this command.

06:22.920 --> 06:31.920
So CD home Kali and after that documents here or Kali two downloads here and as you can see we got two

06:31.950 --> 06:36.130
downloads so you can just get to your documents directory.

06:36.150 --> 06:40.770
Fortunately, there is a simpler solution we can use the instead of using.

06:40.770 --> 06:43.530
So actually let me write that down here.

06:43.530 --> 06:50.400
So in this here, this whole lecture, we use the absolute absolute.

06:52.180 --> 06:53.160
Or actually we can.

06:53.170 --> 06:56.680
So we use the absolute path.

06:57.310 --> 06:59.560
Directory APD.

07:00.100 --> 07:03.320
But now we're going to use the relative directory.

07:03.340 --> 07:05.770
Relative directory here.

07:05.770 --> 07:09.190
So now in order to do that, this is just a simple here.

07:09.190 --> 07:15.810
So instead of writing CD home Kali Linux download, now we can just write here.

07:15.820 --> 07:17.590
Actually, let's go to our.

07:19.430 --> 07:21.920
Here's clear CD.

07:21.920 --> 07:23.540
So we are in the home directory.

07:23.890 --> 07:26.840
CD As you can see, we are in the home directory now.

07:27.350 --> 07:32.720
In order to go to downloads again, just right, it downloads and see the downloads.

07:32.720 --> 07:35.780
And as you can see here, we got into the downloads here.

07:35.780 --> 07:42.170
So relative directory references, lawsuit, a specific destination directory reference relative to

07:42.170 --> 07:43.490
your current location.

07:43.490 --> 07:48.890
So a relative directory reference doesn't start with the forward slash as you can see here.

07:49.700 --> 07:55.100
Instead, a relative directory reference starts with either a directory name, so if you are reversing

07:55.130 --> 08:01.040
to a directory under your current directory or a special character, for example, if you are in your

08:01.040 --> 08:08.720
home directory and want to move to your here downloads directory or downloads sub directory, you can

08:08.720 --> 08:12.860
use the CD command along with a relative directory reference.

08:12.860 --> 08:15.860
So here, let's actually go to a different here.

08:15.860 --> 08:18.200
So CD pictures.

08:18.230 --> 08:20.870
Oops, do do we have pictures here?

08:22.210 --> 08:22.810
Yeah.

08:23.890 --> 08:24.610
And as you can see.

08:24.610 --> 08:26.590
Yeah, see the pictures.

08:27.100 --> 08:31.900
And as you can see, we changed our directory to pictures and.

08:31.900 --> 08:32.300
Yeah.

08:32.330 --> 08:32.740
P.w.d..

08:32.860 --> 08:35.620
And as you can see, we are in the pictures directory.

08:35.620 --> 08:44.350
So in this example I want to note that the no forward slashes, the no forward slashes was used.

08:44.350 --> 08:51.190
So instead of relative directory reference was used and preset, the work directory was changed from

08:51.190 --> 08:59.140
our home collie to home collie pictures with or downloads with less.

08:59.140 --> 09:01.350
Um with less typing.

09:01.360 --> 09:03.160
I'm waiting you in the next lecture.
