Hi everybody and welcome to part three of the Windows command line mini module.
And this video we're going to be talking about the files and directories so we already know what a file
is so it could be a text file.
Could be a P.F. could be a P E.
It doesn't actually matter as long as it's considered a file on the NTFS file system.
How do we create a file.
So the first thing we want to do is create a file.
Now there's a few ways to do this.
The most common way from the command line is just echoing something.
In this case nothing into a file called Tax Day so we can see down here.
We just created a file.
Now this file has nothing in it.
So if we go and open this up I go along.
Yeah that's a default when you don't put anything in there you can turn that off.
But in this particular case if that was off there would be nothing in here.
So now we've got our file and there is another way to create the file.
So I'm going to go ahead and delete this.
So let's make another file.
So that's going to be something is going to be a slightly different way.
So we're going to copy con tax up to 60.
Now when you hit this it's going to ask for some information.
So in this case we don't want anything in there.
Can do control C on the keyboard to go out and kill that all.
Now we have our black text file.
It's a little bit of a different way to do it.
You can add text to it as well.
So if we did that same thing we did test and then control C we should have our test in our perfect so
that allows us to create files.
Now let's say we have our file.
Right.
Got a text text that text.
Now how do we copy this file.
So currently we're in the desktop so let's say we want to copy it to the administrator directory.
Right.
So what we would do would you copy text that text.
And then we're going to go back a directory so you remember this from the navigation video.
Now you can't just put the full path but this is more of a shorthand so we copy this.
We're good to go back in directory.
We'll list it and we can see right there that our text that text is there go back to those top right
actually gives us a good spot.
So what we're gonna do we see our text that text.
Right here.
So now how do we rename a file.
So it's literally the word rename so rename tech start texting secret.
Done.
So again we now see secret texting.
Now if we want to delete a file that's quite simple as well.
DL for short for delete and then secret and now it's gone.
Files are gone.
Cool so make sure to stop and delete the GST as well.
Now we're going to be working with directories just as a quick heads up so to work with directories.
You need to be able to view what's in them so similar to how you can do the file.
So I actually didn't show you.
That's only go ahead and show you.
So if we create a new one their go testing into text that takes time now to view a file from the command
line you just use the word type to stop texting.
Now we see are testing.
Right.
It's good.
Now DVR allows us to view the files folders pretty much anything inside of the the current working directory
which is the desktop.
So if you remember we had the secret dot text I believe we had a named pipe on it or an by alternate
data stream so with DVR if we take a look we can view alternate data streams so see where the hurt is
the slash are so if we did our slash are we can see we have our calc under secret that t here.
So this is a good way to kind of get a better idea.
We also have a slash a which produces the same information which is the default.
However that's slash R shows us that alternate data string.
Now if we want to create a directory so it's it's the command make directory so m K D I R make a directory
D I are we're going name this test.
Right.
So if we list here we see test directory and we can also see it on the desktop in the left corner now
copying a directory is a little bit different as it is in Linux and Windows so in Linux you can copy
the whole file folder and windows you're going to want to copy the contents.
So if we wanted to copy the contents of test directory which is empty right now but let's say we we
didn't.
So we want to create another one a directory up from here.
So we go ahead and create that.
So if we go back up we can see our test directory there.
So if we wanted to copy our contents we're going to do X copy then the current directory that we're
working that we want to copy from and the test
test directory that will copy.
In this case there are zero files there but this will copy all the files from this directory to the
other.
So it's a good way to test that if we need to rename it.
It is going to be exactly the same.
We have rename test directory.
We'll name it test directory temp Go ahead take a look.
Now we have test directory temp deleting the directory is similar to deleting a file.
However it's removed directories that command so R and D I R and then the test.
Well there's not a solution that started with a C.
Now it's gone.
So get familiar with working with files creating files in different ways creating directories working
with directories working with the desire command which is similar to the last command in Linux which
will go over it in those particular videos.
And just remember that viewing the ultimate data streams is also something that you could do as well
play around with the DNR command make a few folders make if you files play around with copying things
it's good to get familiar with understanding how to move things around from the command line because
in and in engagements point of view you're not going to always have the pretty good that we're looking
at right now you're going to have just just this this is all you're going to have so you need to be
able to manipulate enough things and move things around in view what you want to view without actually
having to see the degree itself.