Time
5 hours 21 minutes
Difficulty
Beginner
CEU/CPE
6

Video Transcription

00:00
Hello and welcome to command line basics. In this video, we're gonna go over basic Windows commands. I'm Christopher Hyler, and let's begin.
00:08
So are learning objectives for this video. We're gonna do a quick refresher on the Dura and CD commands. Learn the type command and the way you're going to clear the screen with see less clear screen commit.
00:22
All right. Pre assessment. Which command is used to read a text file on Windows? Is it a cat?
00:28
Be fined
00:30
sie dir or D type?
00:34
The answer is D type. This is a command very similar to cat on limits, where we're going to use it on a file, a text file, and it will spit it out to the screens who we can read it.
00:46
The cat Command does not work on Windows. That is a limits command. The fine command is used to search for things inside of a file, but it's not the best choice to read a full types file and the Dirk Man list along the items inside of a directory, not necessarily what those items contain,
01:06
Right, so a refresher on the Derby and CD command there, almost exactly the same as Lennox, the L S and CD Command. So the dirt tells everything that's inside of a directory. It gives us a really easy overview of exactly what is inside of this folder that we're working in, and we can take a look and see.
01:23
You know, When were these files last modified?
01:26
Who were they given ownership by how big the files are, You know, all sorts of really useful information, and then the CD command is almost the exact same as well in Lennox, where we change directory.
01:42
One thing to do keep in mind with Windows is we need the slash D switch. What we're using change directory
01:49
in order to change a drive within the Windows machine
01:53
and Windows is a little different than Lennox with the file hierarchy, where instead of having one single root with the slash as like with Lennox, Windows has different drives where we have to change a full drive if we're going to get into a different Dr.
02:09
So let's give you a quick demonstration of this. So I'm inside the D Dr text files, as you can see in the top left here. Now let's say I want to see what's inside of this folder.
02:20
Finance I. D. I. R
02:22
and hit Enter, and we can already see that we have a handful files in Hue of the batch file a few text files, another batch file. So a lot of really useful stuff. Now let's say I want to get to my C drive.
02:37
Then I'm going to do cg
02:39
slash d
02:42
C. Colon
02:44
and there we go. We're at the C drive, and now let's say I want to see what's inside of my C drive, so we're gonna do the same thing D I r
02:53
and enter, and we can see a whole bunch of folders that have wronged the root of my C drive
02:58
so we can also do the same CD and then change to a different folder. So let's say I want to go to Windows
03:07
and I just pushed the tab and it's useful. Keep in mind that Windows is not case sensitive at the command line, so you don't have to do a capital W for Windows that we would have to do for clinics.
03:19
We'll go in here and I could type d I. R. Again, and there's a lot of stuff in this folder, and then we can use the seedy space dot dot to go back up a folder directory exactly the same as Lennox
03:31
Arts of the type command. What this does is it allows us to read the contents of a file very similar to cat. And just like, Cat just spits out the entire file all at once. So if there's too much going on at once, we can pipe it into the more command, just like we did on Lennox.
03:47
This will allow us to start reading at the first line, and we can take our time going through line by line or page by page.
03:54
Now, by default, Windows does not have the less command. So as you go down a different lines, you cannot go back up. So that is a bit of a limitation. But you can download the less command unless execute herbal for windows if system you're going to do very often.
04:11
All right, so I'll go back to my command prompt, and we're gonna change back to the deed directory.
04:17
So I did seedy space. Forward slash d. D Cohen.
04:23
This brings us back into our last place on the D Dr
04:27
type there to see what is inside of this folder. And let's say I want to read what's inside file one that t X t
04:32
I'm gonna do type Final one
04:36
and hit Enter And there we go. This is the first text file here useful. So now we can see exactly what was inside of that file and it was easy.
04:46
But let's say we have a longer file, so I'm gonna do type longer, found up T X t.
04:53
And as you can see, our screen just exploded. We have a whole this activity and we couldn't see the start,
04:59
So I've had Thea pare aqui space
05:01
pipe
05:02
and more so it's gonna take the standard output from this tight command putting into the more command.
05:08
And now you can see in the bottom left here, said Maur. And this allows us to read starting at the first line at the top so we could take our time reading through the output instead of having everything come all at once. And then we can enter to go down in line or the space bar to go down a page. But
05:26
just like with more and Lennox, we cannot scroll back up.
05:30
All right, Now we have the clear screen command, the C l s for Windows. And what this does is it removes all the text on the screen, and it'll allow you to kind of refresh the command line. So this is a useful ways. You have too much coming on at once, and you just need a refocus on what you're doing. Just I've been seeing less
05:49
and you can start all over
05:50
just the same Miss Lennox.
05:54
So I'm gonna be back at my prompt. And let's say I don't like all these words. It's making me distracted. I don't know what I'm doing. So we're just gonna see s let me spell that properly enter and look at that. It's all refreshed. Brand new. I could start all over now to focus on what I'm doing.
06:11
So it's a useful way to kind of regain control if you feel like too much is going on on the problems at once.
06:17
All right. Post assessment. Which CD switch is used to change a drive? Is it a slash dr Be Sasha a c slash z where d slash d?
06:30
The answer is deep slash d This is the CD change directory. Switch the slash D for a drive in order to go to a different drive on windows.
06:42
The slash tries slash a and slashes, See are not valid options in order to change a drive with the CD command.
06:49
It's a video summary. We did a quick refresher on the during the CD commands. We've learned the type command and how it's very similar to the cat and, uh, you know, take that I would put in play, but into more if there's too much coming in at once, and we also learned how to clear the screen with seal us, and I hope to see you in the next video.

Up Next

Command Line Basics

In this course you will learn the fundamentals of Command Line, a fundamental tool for any user of Windows and Linux machines. Command line allows developers to manipulate files easily and quickly. Learning command line saves developers time and resources.

Instructed By

Instructor Profile Image
Christopher Haller
Senior Intelligence Operations Analyst at Centripetal
Instructor