Hello, my name is Typhoon and welcome to another lecture of our course.
In this lecture of our course, you will learn about the traversing directories and you will use the
absolute directories for references.
So let's get started.
So you can you change the directory to move your shell session to another directory in the Linux file
system?
So this CD command, this syntax is pretty simple.
So you first enter the CD, which means change directory, and after that you enter the destination
here.
So the CD command may take a single argument as a destination here.
So you will enter destination here.
So which this destination specifies a directory you want to go.
So if you don't specify a destination on the CD command, it takes you to your home directory here.
So if you make it like that, CD downloads and after that CD and as you can see here we go to Home Directory
again.
So you will in this chapter you will learn the um, each of these methods and you will learn about the
differences between these two methods are important to understand as you traverse the file system so
you can reference a directory name with within the virtual directory system using the absolute directory
reference.
So the absolute directory reference defines exactly where the directory is in the virtual directory
structure and starting at the root.
So think of the absolute directory reference as the full name for the directory.
So an absolute directory reference always begins with a forward slash indicating the virtual directory
system's root.
So fuse to reference user binaries contained within the user directories.
Bind bind some directory here so you you will use so user here and here you can.
As you can see whenever I click to the tab here, oops, here.
So whenever I click the tab button on my keyboard it will show make.
Uh, possible inputs for my command here.
So in this case, we will enter the bin here so usr bin.
And as you can see, we changed our directory to usr bin.
So there's no w as to exactly where you want to go.
So to move to a specific location on the file system using the absolute directory or reference, you
just specify the path name in the C command.
So we can also do like that.
For example, let's make it go to home.
And as you can see, we are in the home and let's go to user bin user.
USR bin.
And as you can see here, we changed our directory to usr bin here.
Also, did you notice that the this example that the prompt originally had a title here, had a title
in it, and after that change to Native Directory occurred, the title was replaced by being here.
As you can see here.
Firstly, we had a title here, but whenever we clicked and changed the directory there, we showed
us that we are you.
We are at a different directory other than our home directory here.
So this is where the command line interface prompt can help you keep track of where you are in the virtual
directory structure.
So the tiled indicates that your cell session is located in your home directory.
Like this, for example.
Let's go to home and as you can see, we are in the home now.
So after you move out of your home directory, the partial directory reference is shown in the prompt.
So if the prompt has been configured to do so.
So if your prompt has not been configured to show the shell session current absolute directory location,
then you can display the location via a shell command.
The WD command displays the shell session's current directory location, which is called the present
actual.
Let me write it right here.
So.
So this called present.
Working.
Directory.
Here.
As you can see, p w d means that present working directory.
So if you write the D here and as you can see, we printed us the our working directory in our shell
here.
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
directory.
And as you can see here, we printed our current working directory.
As you can see, these are not the same because we changed our working directory.
So you can move to any level within the entire Linux virtual directory structure from any level.
Using the absolute directory reference, we can also go to, for example, CD actual let's clear the,
we can also go to CD var log here.
And as you can see here, we got to var log.
So this changed here and whenever we write the CD and as you can see here, we are seeing our working
directory now.
So you can also quickly jump to your home directory from any level within the Linux virtual directory
structure with just a simple CD command.
And as you can see here we are in the home now.
However, if you are just working with your own home directory structure, often using the absolute
directory references can get tedious.
So for example, if you are already in the directory of our home column, it seems somewhat cumbersome
to have to type this command.
So CD home Kali and after that documents here or Kali two downloads here and as you can see we got two
downloads so you can just get to your documents directory.
Fortunately, there is a simpler solution we can use the instead of using.
So actually let me write that down here.
So in this here, this whole lecture, we use the absolute absolute.
Or actually we can.
So we use the absolute path.
Directory APD.
But now we're going to use the relative directory.
Relative directory here.
So now in order to do that, this is just a simple here.
So instead of writing CD home Kali Linux download, now we can just write here.
Actually, let's go to our.
Here's clear CD.
So we are in the home directory.
CD As you can see, we are in the home directory now.
In order to go to downloads again, just right, it downloads and see the downloads.
And as you can see here, we got into the downloads here.
So relative directory references, lawsuit, a specific destination directory reference relative to
your current location.
So a relative directory reference doesn't start with the forward slash as you can see here.
Instead, a relative directory reference starts with either a directory name, so if you are reversing
to a directory under your current directory or a special character, for example, if you are in your
home directory and want to move to your here downloads directory or downloads sub directory, you can
use the CD command along with a relative directory reference.
So here, let's actually go to a different here.
So CD pictures.
Oops, do do we have pictures here?
Yeah.
And as you can see.
Yeah, see the pictures.
And as you can see, we changed our directory to pictures and.
Yeah.
P.w.d..
And as you can see, we are in the pictures directory.
So in this example I want to note that the no forward slashes, the no forward slashes was used.
So instead of relative directory reference was used and preset, the work directory was changed from
our home collie to home collie pictures with or downloads with less.
Um with less typing.
I'm waiting you in the next lecture.