Hello and welcome to Command Line.
In the studio. We're going to go
over basic Windows commands.
I'm Christopher Haler.
And let's begin.
So we're learning objectives for
this video. We're going to do a
quick refresher on the Dir and CD
commands, learn the type
command, and then we're going to
clear the screen with the SEALs
clear screen command
pre assessment, which command is
used to read a text file on
Windows? Is it a cat?
B, find C
Der or D type.
And the answer is D type,
this is a command very similar to
Cat on Linux, where we
are going to use it on a
file, a text file, and it'll spit
it out to the screen so we can read
it. The cat command does not
work on Windows and is a Linux
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 text file and the command
lists all of the items inside
of a directory. Not necessarily
what those items contain.
All right, so a refresher on the
Durnan CD command there, almost
exactly the same as Lennix,
the 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 are working in.
And we can take a look and see
when were these files last
modified?
Who were they
given ownership by,
how big the files are
all sorts of really useful
information.
And then the CD command is almost
the exact same as well in
Linux, where we change
directory.
One thing to do, keep in mind with
Windows is we need these
the switch when we are using
change directory in order to change
a drive within the windows
machine and windows
is a little different than Linux
with the the file hierarchy where
instead of having one single root
with the slash, as with
Linux, Windows has different
drives where we have to change
a full drive if we want to get
into a different drive.
So let's give a quick demonstration
of this. So I'm inside the drive
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
are in it.
And we can already see that we have
a handful of files in here
of the batch file through text
files, another batch file.
So a lot of really useful stuff.
Now, let's say I want to get to my
C drive, then
I'm going to do a CD
slash D
C colon.
And there we go.
We are at the C drive and
now let's say I want to see what's
inside my CETRA.
So we're going to do the same thing,
the R and
enter and we can see a whole bunch
of folders that are from the root of
my strength.
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
and I just push 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
would have to do for Linux.
And we'll go in here and type
dargin and there's a lot of stuff
in this folder and then
we can use the CD space dot
dot to go pick up a folder
directory exactly the same as Linux.
Rights of the type command, what
this does is it allows us to read
the contents of a file very similar
to that.
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
Linux.
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.
Now, by default, Windows does not
have the less command.
So as you go down different
lines, you cannot go back up.
So that is a bit of a limitation.
But you can download the last
command of this executable for
Windows if this is something you're
going to do very often.
All right. So I'll go back to my
command prompt and we are going
to change back to the directory.
So I did CWD Space Forward
slash D d colon.
And this brings us back into our
last place on the drug.
I'm going to type there to see what
is inside of this folder.
And let's say I want to read what's
inside file one that
I'm going to do type file
one 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.
But let's say we have a longer file,
so I'm going to do type
longer, found up to 60.
And as you can see, our screen just
exploded. We have all this activity
and we couldn't see the start.
So I need the other key space
pipe and more.
So it's going to take the standard
output from this type command, put
it into the more command.
And now you can see in the bottom
left here, it's a more and this
allows us to read starting up the
first line at the top so we can take
our time reading through the output
instead of having everything come
all at once.
And then we can enter to go down the
line on the spacebar, to
go down a page.
But just like with more on Linux,
we cannot scroll back up.
All right, now we have the clear
screen command, the calls 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 way if
you have too much going on at once
and you just need to refocus
on what you're doing, just type in
signals and you can start all over
just the same as Linux.
So I'm going to 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 going to see s
let me spell that properly.
And I'm lucky that it's all
refreshed, brand new.
I can start all over now.
I can focus on what I'm doing.
So it's a useful way to regain
control, if you like.
Too much is going on on the ground
at once.
And post assessment.
Which Code Switch is used to change
the drive? Is it a flash
drive, B, A,
C, Z
or D slash D.
The answer is D d
This is the CD change
directory switch
the slash D for drive in
order to go to a different drive on
windows.
These flash drives A and
C are not valid options
in order to change a drive with the
CD command.
It's a video summary.
We did a quick refresher on the deer
in the CD commands.
We've learned the type command and
how it's very similar to the cat and
take that output and pipe it into
more if there's too much coming in
at once.
And we also learned how to clear the
screen with SEALs.
And I hope to see you in the next
video.