After the introduction in the last lecture for
Net OS computers and the so called terminal so the
Net computers
command life interphase,
it's now to dive into the command prompt
on Windows machines.
As explained earlier in this module,
the command prompt is
the traditional command by interphase on
Windows machines.
For this purpose we will dive into the basic commands
you have to interact with
your machine well with this command prompt.
For this I open a graphic user interphase to the left.
That's your traditional Windows Explorer.
Here I went to my computer here,
then to the C-Drive
and then to the Users Folder.
And here you can find your
username, my case, my name here, and then I
open this folder here.
Why did I do this?
Well, because, now it will switch from this
graphic user interphase to the command prompt
and see where we can find this folder.
For this you can press the Windows key on your
keyboard and search for command prompt.
If you do so and open it, we have the command
prompt here to the right and we are also in
my Users Folder, here right?
In "C" "Users" "Manuel Lorenz."
So basically we are now
accessing this folder here in our explorer
in the graphic user interphase and to the right
here in the command prompt. Now you might say,
"Well if we are in the same folder, why can't I
see all these folders and files in here?"
Well, this is of course possible. We can simply enter
commands in this command prompt. And one command
here is simply "dir" for directory,
which will list all items to all folders
and files which you have in this directory.
With that you see we get overview of all the
content of this folder, as we see to the left.
For example, this anaconda folder and so on.
So this if our first command prompt step here.
And we are now in the so called "home directory."
You basically have three core directories on
your machine and this is the home directory,
the user's directory, and root directory.
Now what is the user's directory now? If we
switch up a level here on our graphic
user interphase, to this folder, this is
the user's directory. My case, I only have one
user and this default one, but you could have
multiple users in here and all these users
would be part of this user's directory.
Now how can you access it? Well, you have
plenty of options. But if we are now in this
Manuel Lorenz folder here in the command prompt
and what I just did is, I have navigated one
folder up actually. Well, I can do the same
thing in the command prompt by adding the "CD"
command. "CD" stands for change directory and
with two dots this simply tells our command
prompt change directory and move one hierarchy
level, so one folder level, so to say up.
If we do that, you see we are currently in
"c://Users>" so basically C users here
in the explorer and if we again add "DIR"
to show our content, you see we have the same
folders that we have in our explorer.
So this is our Users Directory. If we move
another level up on to the C-Drive in my case,
we are in the so called Root Directory.
So the starting point of the hard disk drive
so to say. We can also do the same thing here
in our command prompt of course by entering
"CD .." once again and you see we are now
on the C-Drive basically and the DIR you see
we again have the same folders. Besides these
three directories, we can also change our
hard disk drives because, well, in many cases of
Windows machines you don't only have a C-Drive
you also have the D-Drive and so on.
Changing the hard disk drive is very easy.
You simply enter the hard disk drive with a
capital letter and then a colon. If you do that,
well, you see and now on the D-Drive and I can
navigate around as I saw it on the C-Drive here.
If I want to go back to my C-Drive, which is
typically the well, initial drive to have for
the core drive of the Windows installation on
your machine, you enter "C:"
and now you are back on the C-Drive.
So these are the first steps in the command prompt.
You see that we
start a command prompt in our so called
Home Directory and that we have this User's
and Root Directory and that we can change our
different drives well with the
command prompt here. The question now is,
"How can I now access folders?"
For example, Safari only saw "CD.." to move
one level up, but how can I go back to my
Home Directory, for example.
Navigation in the command prompt can be done
in two different ways: with absolute
or relative paths. A relative path simply means
"I always start from my current location."
So in my case I'm in the C-Drive here
and if I enter DIR once again, you see we have
all these folders here, so the same structure
that we saw to the left. We know that our Home
Directory is located in that Users Folder.
So what I can do now is, I can enter "CD" and
now simply "Users" right?
And tag for auto-completion.
This is the default.
This is a relative path because I am starting
from my current location and am now accessing
another folder. If I do this,
I am now in the Users Folder.
So if I replicate this here
I'm in here. This means if we enter DIR once
again you can now say, "please access the
Manuel Lorenz folder here" or your username,
of course. So you again type "CD" again from your
current location and then your name. Again you
can enter auto-completion. You see these
quotation marks which automatically added if you
have a space here. So make sure you do the same
or, as I said, the auto-completion will
already implement this. And if you do that
now you are back in the Users Folder.
Starting from this folder in here, you can then
navigate in all the other folders always with
the CD command and then well the folder name.
For example, in here we also have the desktop,
right? Here I have for example this
GIT Basics folder. Now I can also say,
"Please navigate from the Manuel Lorenz folder
on to my desktop" right here.
Now a backslash
and now enter this GIT Folder,
this GIT Basics Folder. You don't have this
folder, so you can use another folder that
you might have on your desktop. That's again
a relative path and if I do this, I am now
in this folder.
So this is a relative path.
We also have absolute paths, though.
An absolute path is what you
can always see right here.
This is an absolute path and the absolute path
always starts from the Root Directory, so this
C-Drive here.
Then you get all the folders you want to access
up to the point where you finally are.
And you can use such an absolute path
from anywhere.
So no matter if I'm now in this GIT Basics Folder
and if I want to navigate in to my Home Directory
here, I can simply do this with "CD" and now,
can't see it,
make this bigger,
and now I can navigate in to this folder
like this, right.
Or if I go back to my Root Directory,
for this we have a nice shortcut, by the way,
this is "CD /" so now I'm again in the
Root directory.
And if I now enter a "CD" and now this
absolute path right here, so I can simply
copy and paste it here to make it easier
for us, and I copied the wrong thing,
that's the problem with copy and pasting,
of course, I just want to access
this part here.
So, like this
so we say "CD" and now "C://Users" is on.
If we do that, you see I am now back in the
GIT Basics Folders.
So these are absolute and relative paths.
Absolute paths always start from the
Root Folder of the current drive whereas the
relative path always starts from your current
location, which you can see here
in the command prompt.
Now, when should I use what?
Well, typically we work with absolute path,
specifically development and web development
because if you think about the project that you
have here in that GIT Basics Folder, for example,
and inside this project you have different
references to other files and folders,
but if you would use absolute paths for this
and your username would change,
then the project would break.
With a relative path, you are always starting
relative from your current location.
So inside this project folder, therefore,
the project doesn't break no matter if you
move it to another computer or cloud or
any where else.
With that we can actually navigate one level up
to our desktop here and we can also clean our
command from here because we have lots of
information here.
To clean or clear the current
command prompt statutes, you simply type "CLS."
Like this.
With that you have a clean window here again.
So we saw our different directories,
we learned how to change directories,
and we learned about absolute and relative paths.
What we didn't learn so far is how we can
actually create things in the files and folders.
Maybe this is what we will tackle next.
Right now we are on the desktop
in our command prompt.
You can also see to the left in our explorer.
And now I want to create files and folders.
Well, we can use DIR for example to see which
files and folders we have.
But I want to create a new one, a new folder,
to be more precise.
Folders can be created with the "MKDIR" so
make directory command.
Then you simply add a folder name.
For example,
command prompt.
You do that.
You see to the left already that the
folder was created and you can also use this
DIR, you know how this works in the meanwhile,
and we can now navigate into
this folder with relative path.
You know how this works. So "CD", then "com"
and then you can press tab. And with that
we are now in this command prompt folder.
Like this.
And inside this folder, am I going to
create another folder.
Let's create another directory and say
The Basics,
something like this,
right?
So we have this folder now.
Now we can navigate into it.
And inside this folder am I going to create
a file, let's see, a simple text file,
for example.
Files can be created with these so called
echo command.
Echo, written like this, and then the content
of this text files, maybe
our first file, in here
I'll make this again a bit bigger for you.
Then, you add this larger than sign
and then you add the file name and the file type.
So this could be a simple
test.txt. File. Like this.
So Echo, then the content of the file,
then the larger than symbol, and then
the file name and the file type.
If we do that, we don't see a lot,
but with DIR
we see it that now we created
this text.txt file here.
And if you now want to see what's inside
this file, you can simply enter
type test.txt
because we are inside this folder so we can
access this file and if you do that you see
that you see that this contains this
our first file test in here.
Besides creating files and folders,
let's go here and clear this again.
Besides creating files and folders,
we can of course also delete these.
For that we are now again here in
our basics folder.
Let's now say, "Mmm, this text.txt file
wasn't actually what I wanted"
so let's delete it.
For this you can simply say "del"
for delete and now refer to the file.
If you do that and check the content of the
folder again, the file is gone.
Same thing can also be done for a folder actually.
So let me first create a folder in here, a new one,
a delete folder, right so we create a
directory delete.
And now if we say, "Mmmm, actually don't
need this one" we cannot make directory
but remove it with remove directory,
"RMDIR" and then refer to this delete folder.
Do that and then check it,
you see the folder is gone.
So this is how you can create files and folders
and how you can also delete these.
And with that we will conclude this crash
course on the Windows command prompt
because for both, the purpose of this module
so to learn GIT and GIT UP, and also for
the purpose of this entire course,
the knowledge we gain so far is absolutely
sufficient.
Therefore, in the next lectures, we will
dive into the installation of GIT on our machines.
In the next lecture we will install GIT on
Net OS computers, so as Windows user you can
skip this lecture and afterwards,
we'll have a look at how we can install GIT
on Windows machines.