2.5 Windows Common Tools

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 »

Time
5 hours 21 minutes
Difficulty
Beginner
CEU/CPE
6
Video Transcription
00:00
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.
00:10
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
00:23
pre assessment.
00:24
So
00:25
moving a file is a way to rename it true or false.
00:32
Answer is true.
00:34
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
00:51
if you move a file, it makes a copy of it
00:55
at the new location and then deletes the original copy of it.
01:00
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.
01:15
And this displays the file one screen at a time.
01:19
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,
01:34
all right? And now I will get a quick demonstration of these commands.
01:40
So I'm gonna open up the command prompt.
01:42
I'm going to type D i r to see what is inside of this directory,
01:47
and I need to get to my desk time folder. So I will see d D E s K tab on a complete inner
01:56
another D i r to see what's inside of my desktop directory,
02:00
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.
02:17
Enter D I r. Again and I have to text files another directory in here.
02:23
So first I'm going to do the type command on words T X t
02:29
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.
02:38
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.
02:50
So type there again. You can do type
02:54
longer file
02:57
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.
03:07
So that is where the more command comes in. And this is very similar to the more command on Lennox
03:14
type, more longer file.
03:16
And this allows us to read from the first line of here at the top
03:21
and similar. We can push enter to go down one line,
03:24
or we can push the space bar, do it on a full page at a time.
03:29
So that is the type. And the more commands that you could read text from the command line
03:37
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
03:57
for copy, we can copy files and folders. Move, move files and folders.
04:00
And we actually have a rename command inside of windows where we can actually
04:06
change the name of our final instead of having to use a move command to change it for us.
04:14
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.
04:30
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.
04:46
I am going thio copy
04:50
words that t X t and I'm gonna name this words to t x t
04:59
and do another d I r. And we have our words to file.
05:01
And now I will delete
05:04
words too.
05:06
Press Ted
05:09
there again, and it is gone. So we were able to successfully copy and delete that file
05:15
from the command line.
05:18
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
05:30
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.
05:45
Uh, let me see. I believe I put another secret in the longer file for windows, so let's see if we can find
05:53
secret in longer. Fine.
05:57
Ah,
05:58
I need to do my help. Find slash Question, Mark.
06:02
All right, so let's see.
06:05
Looks like the string needs to be inside. Quote.
06:09
So what's to find secret
06:13
and then long file?
06:15
And there it looks like it found something.
06:23
Where is it?
06:26
That
06:30
ah, secret.
06:32
It was right in front of me the whole time. And let me market
06:36
There we go.
06:38
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.
06:47
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
06:56
be less see text or D type?
07:00
And there are two correct answers to this question.
07:04
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,
07:14
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.
07:25
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
Up Next