All right. Hello and welcome to
Command Line.
This module will be an intro
to Common Windows Tools.
I'm Christopher Haler and let's get
started.
So the learning objectives for this
module is we want to learn how to
read files, learn how to copy files,
understand how to delete files,
and understand how to search through
files all from the Windows command
line
assessment.
So moving a file
is a way to rename it true
or false
answer is true.
If you were watching the previous
video, you learn from the wouldn't
the Linux commands excuse me that
the move command is also
used to rename files
in the special kind of way.
So it's the same deal with Windows,
the same kind of ideas behind
it, where if you move
a file, it makes a copy
of it at the new location and
then it deletes the original
copy of it.
All right. So reading text files
from the Windows Command, we
got two commands we can use.
We have the type command which
displays the contents of a file,
and we also have the more command,
which is very similar to the
Linux, more command.
And this displays the file
one screen at a time.
So if there is too much,
too much text on the screen at once,
more will allow you to read it.
And then you can choose to go
either one line down with the enter
key or go a page
down with the spacebar.
All right. And now I will give you a
quick demonstration of these
commands.
So I'm going to open up the command
prompt, I'm going to type
to see what is inside of this
directory and I need
to get to my desktop folder so
I could
ask a tab on
a complete and or
another Dyax to see what's inside
of my desktop directory.
And I need to get into this
resources folder.
So I will do c, d, r, e
s.
And as you may know, Windows
is not case sensitive like Linux
is. So I can do a lower case r here
push tab and it will
automatically autocomplete it
with a capital R and
enter dargin
and I have to text files another
directory in here.
So first I'm going to do the
type command on words
and this is great.
It spits out all of the
text inside of this text file
so that we can read it from inside
of the command prompt here.
Now a limitation of
the type command is that if you have
a longer file,
unless you have this kind of
scrollbar, it's it's not
going to be able to be read very
easily.
So I type there again,
you can do type
lunger file
and liley that if we did
not have this rollbar here, it would
be very difficult to
be able to read the first
half of this file, among others.
So that is where the more command
comes in.
And this is very similar to the more
command on Linux
type, more longer file.
And this allows us to read from
the first line up here at the top.
And similarly, we can
push enter to go down one line
or we can push the spacebar to
a full page at a time.
So that is the type.
And the more commands that you can
read text from the
command line.
Aren't copying files, this
can be very similar to the Linux
commands as well.
They are named differently, though,
so instead of S.P., this is the full
copy instead of MVE
or R.M.
for deleting. We have move
and we have Dell
for delete.
So for copy we
can copy files and folders, move,
move files and folders and
we actually have a rename command
inside of Windows where we can
actually change
the name of file instead of having
to use a move command to change
it for us.
Now deleting files,
we have the Dell come in, this can
be used to delete files
and erase command is the
same as the Dell Command.
It is just what's known as an alias
for it. So it's kind of like a
secondary name for the same command.
And if you find yourself in
the position where you need to
delete full directories,
you can use the as
a switch and then that will delete
a full directory for you.
So let's do a quick demonstration of
that.
I am going to
copy
words that
and I'm going to name those words
to the text
and do another dyanne.
And we have our words to file.
And now I will delete
words to
press tab
Durgan and it is gone.
So we were able to successfully copy
and delete that file.
From the command line.
All right, now, searching through
files, we are going to use the find
in the fine string, so find
it searches for a string, which is
just a fancy way of saying
text inside of a file
and the fine string that
commanded a little more robust.
And it can use regular expressions
or regex, and that's for
certain pattern based searching.
So I will show you a quick example
of that.
Let me see. I believe I put another
secret in the longer file for
Windows, so let's see if
we can find secrets
in longer five.
Oh, I need to do my
help. So find
questionmark.
All right. So let's see.
It looks like the string needs to be
inside, quote, so
let's to find secret
and then long file final
and there we go.
Looks like it found something.
Where is it?
Secret, it was right in front
of me the whole time and let me
market we go.
So that's how I use the the
fine command. You have to use the
quotes. And, you know,
just like you, I'm going to have to
use them as much as I can.
I post assessment, which commands
can be used to read text on Windows
and this can be a multi answer
question. Is it A more
B less C
text or D type.
And there are two correct answers to
this question.
The correct answer is more tintype,
those are the two commands, so we
went over where we can read text
from text file at the command
line, the less command,
while it is a very useful command
in Linux, it is not natively
supported in Windows.
And the text command is not a real
command for reading text.
All right. So in this video, we
learned how to read files, how to
copy files, understood how
to delete files and understood
how to search through files.
And I look forward to seeing you in
the next video.