2.5 Windows Common Tools
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
Already have an account? Sign In »
5 hours 21 minutes
all right. Hello and welcome to command line Basics. This module will be an intro to common Windows tools. I'm Christopher Hyler and let's get started.
So the learning objectives for this module, it's we're gonna learn how to read files, learn how to copy files, understand handed delete files and understand how to search through files all from the Windows Command line
moving a file is a way to rename it true or false.
Answer is true.
If you were watching the previous video you learned from the wooden, the linens Command's excuse me that the move command. He's also used to rename files in a 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 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 Lenox 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 page down with the space bar,
all right? And now I will get a quick demonstration of these commands.
So I'm gonna open up the command prompt.
I'm going to type D i r to see what is inside of this directory,
and I need to get to my desk time folder. So I will see d D E s K tab on a complete inner
another D i r to see what's inside of my desktop directory,
and I need to get into this resource is folder. So I will do C D R E s and ah, As you may know, Windows is not case sensitive like Lennox is. So I knew a lower case R here push tab and it will automatically auto completed with a capital R.
Enter D I r. Again and I have to text files another directory in here.
So first I'm going to do the type command on words T X t
and this is great. It spits out all of the tanks inside of this text file so 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 scroll bar, it's it's not gonna be able to be read very easily.
So type there again. You can do type
and let me that if we did not have this robe are 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 Lennox
type, more longer file.
And this allows us to read from the first line of here at the top
and similar. We can push enter to go down one line,
or we can push the space bar, do it on a full page at a time.
So that is the type. And the more commands that you could read text from the command line
aren't so copying files. This is gonna be very similar to the Lenox commands as well. Uh, they are named differently, though. So instead of CP, this is the full copy. Instead of envy or R m for deleting, we have move and we have DEL 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 our final instead of having to use a move command to change it for us.
Now the leading files, we have the Del command. This can be used to delete files and the erase command is the same as the Del 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 thes slash s switch and then that will delete a full directory for you. So let's do a quick demonstration of that.
I am going thio copy
words that t X t and I'm gonna name this words to t x t
and do another d I r. And we have our words to file.
And now I will delete
there again, 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're gonna use the find and the final string. So fine, it searches for a string, which is just a fancy way of saying, you know, text inside of profile
on the fine string that commanded a little more robust. And it can use regular expressions or Reg IX, and that's for certain pattern based searching. So I will show you a quick example of that.
Uh, let me see. I believe I put another secret in the longer file for windows, so let's see if we can find
secret in longer. Fine.
I need to do my help. Find slash Question, Mark.
All right, so let's see.
Looks like the string needs to be inside. Quote.
So what's to find secret
and then long file?
And there it looks like it found something.
Where is it?
It was right in front of me the whole time. And let me market
There we go.
So that's how you use Thea. Fine command. You have to use the quotes. And, you know, just like you, I'm gonna have to use the as much as I can.
All right, Post assessment which commands could be used to read text on windows. And this is gonna be a multi answer question. Is it a more
be less see text or D type?
And there are two correct answers to this question.
The correct answer is more and type. Those are the two commands that 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 Lenox, 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