2.3 Changing Directories
Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or
Already have an account? Sign In »

Video Transcription
00:00
all right. Hello, and welcome to command line Basics. This module is going over navigating directories. My name's Christopher Heller, and let's begin.
00:10
So for this video, we're gonna learn how to change directories. Understand how to change drives inside of the command line, used the tree command, learn about that and make new directories from within the command line.
00:26
All right, Pre assessment. What command can be used to make a new directory? Is it a new dear
00:33
be make directory?
00:35
See,
00:36
M Kader or di Dir Tech, Tech new.
00:41
And we're going to make a new directory.
00:44
The answer is C. M. Kader for make directory.
00:49
Ah, the new dirt command is not a real command.
00:54
The Make Directory Command spelled out that while yes, see is
01:00
the shortened version of make directory. The full spelled out make directory is not a real command and dirt dash dash new is not a command to create a new directory.
01:14
All right, so changing directories is something you are going to do very frequently from the command line. And it's a very important, uh, skill. You need to understand that when you can move through the directories like you would with a gooey and how you're clicking through a folder, going through different levels
01:30
and, you know, copying, pasting from different techniques that we've learned in this course as well.
01:37
So in order to change directory, you're going to use C. D. And this is the same command that is in Lenox and Windows. And these have the same kind of basic concepts behind him. To where if he do seedy space dot dot that will go up a directory.
01:55
And if you use on Windows, if youse cd
01:59
forward slash d and then put in a new drive, it will help you change which drive you are on and which drive you're looking through from the command line.
02:08
And that's for Windows only. Because that's the way that Window's likes to, uh, you know, manage those kind of drives from that perspective where Lennox has the root of the file system and there's no need to change drives.
02:21
So let me give you a quick demonstration.
02:23
All right, so I have my command prompt. Open, as you can see, right now, I'm at the sea users and then my user folder right now.
02:31
So I'm gonna do dare to see what is inside my user folder,
02:37
and I have a whole bunch of different folders inside of there.
02:40
So when I want to do is I want to get into my
02:44
ah desktop folder. So I'm gonna do CD
02:47
desk
02:49
and first have fur on a complete.
02:52
All right, now, I am in my desktop folder. I'm going to type D I r again
02:57
enter and look at all these files I have on my desktop.
03:00
And now I can go ahead and I'm going to go into my resource is folder I have They're so CD R E s tab
03:12
enter, and then D i r again to see what is inside of this folder.
03:16
And I have another folder inside of there. The Frankenstein I got to text files as well. So, uh, now let's say I want to go up a folder, go back to my desktop because I really wanted to go into my documents folder so you can do C d space dot Not and this brings me back up a directory to my desktop.
03:37
Now, you can also put that together, huh?
03:39
With other
03:42
directory levels. So it's a CD dot DOT backs lash dot dot
03:49
I won't go up to directory levels. See how I skipped past
03:53
the my user folder and my desktop folder and went directly into this user shoulder.
03:59
So that is a useful way to go up.
04:01
Or you can just type in the folder directly. So if I do change directory and then go straight to the root of the C drive brings me right there.
04:12
Now, if I want to change my directory and get to my d Dr Gonna do seedy space forward slash d
04:19
d
04:20
backslash and he ran D i r. And this is inside of my i d Dr.
04:28
All right,
04:30
So that's how you're moving around inside of folders inside of directories, changing directories. It's a very important concept that you need to be very comfortable with.
04:39
All right, so we also have the tree command with the tree commandos. Is it graphically displays, folder and file structure from the command line. And I already know what you're thinking.
04:49
Ah, you told me that the gooey was graphical only. And the command line is not graphical. It all true. You will see. I will show you a demonstration of the tree command and you will understand how it is graphical in nature inside of the command line. All right, so you can also do tree slash f
05:09
and that will show all the files that are in the structure as well.
05:15
And, ah, just like we can do with the text files, we can pipe it into Maur. If the listing is too long that way, we can go through line by line and see exactly what's going through.
05:27
And then, uh, I will show you on Lennox as well. All right, so let's do
05:33
tree
05:35
and look at that. I have all sorts of things in my d drive here, and that was way too fast for me. So I'm going to do tree
05:45
fresh
05:46
and look at all those files that I have as well.
05:51
Wow, that's too much. I'm going to interrupt that. All right,
05:56
tree,
05:58
And let's put that into more.
06:00
And now I can take my time
06:01
and go through all of these folders.
06:06
All right, so that is how you can use the tree command. Let me pull up my
06:15
Lennox machine and we'll try that. So we have a tree
06:18
and the show's a graphical representation from the Lenox. Uh, as well. So let me go up
06:27
another few and tree, and we could see a whole bunch of good stuff
06:31
and same thing with windows were tree. Excuse me and then more,
06:38
and we can go through. We take our time looking through this folder structure to help us understand what we're looking at from the command line. Now, if you're using a Lennox Mint destro, I know that what I had to do is I had to use Theseus. Ooh, after
06:54
installed tree command And what, we'll go over the suit of command in the APP get aft, and saul commands at a later time in this course.
07:01
But, ah, what that does is ah, since the tree command is not natively installed in Lenox Mint, uh, it will download and install the tree command so that you can use it.
07:15
All right, making directories. M. Kader that creates a new directory and MD that can also create a directory. So let's take a look at Matt.
07:27
All right, so I'm want to make a new directory on my d drive here, So I'm gonna do and Kader
07:34
new full
07:38
and dirt
07:40
Let's see. Where is it? Ah, here it is.
07:43
New folder. That's her folder.
07:46
All right.
07:48
And just like for the delete and erase commands, there is tthe e m d alias for Victor for Windows.
07:58
All right, post assessment.
08:00
What is the tree command used for? Is it eight or creating a folders? Be to read files, see to search their files or D d graphically display folder structure.
08:13
And the answer is D to graphically display folder structure. So, uh, it is treat does not create in folders. That is for the make directory, command or maker.
08:24
It does not read files that is tthe e type or the more command that we've covered,
08:28
and it does not search their files. That is the fine command.
08:33
All right, So in this video, we learned how to change directories, understood how to change drives,
08:37
used the tree command and made new directors. I hope to see you in the next video.
Up Next
Similar Content