Hey guys, thanks for joining me. In this video, we're finally gonna get to the
command line, and I'm really excited about that because this is probably the key
aspect to Linux that you're gonna need to learn. It's great to have a bit of
background knowledge, and how to install the system, but those are very small
and insignificant in comparison to how much you'll be working with command line. So,
to open up the command line we use a program called terminal, and you can
access this is in the applications menu by typing terminal, or you can hit CTRL,
ALT, and T on your keyboard and it will launch terminal. So, here is terminal and
we're going to talk about just a few commands today. The first one is going to
be PWD,
and what PWD does is it prints working directory. So, if I type it here
it's going to list the current directory that I'm in, which is /home/nick. This is my user directory, this
is the default location that you'll be in. The second command that we need to talk
about his CD, or change directory. So, this allows us to basically change which
working directory we're in. Now, I can type /user/share, for instance. It's gonna
take me to the /user/share directory, and I'm gonna show you guys here in the file manager
what this looks like. If I click computer here, it's gonna take me to the root
signified by a "/." So, when you're changing directory, if the first character
after CD is a forward slash, that means it's going to be an absolute path from
the beginning of the hard disk, or from the root directory.
So, here I could change directory in to /sbin, or I could CD into home.
We've got a directory called Nick. So, how to change directory with a relative path,
you just omit the "/" and this will basically tell it to change
directory from whatever directory I'm in, to the next level which is Nick, and I end
up here. So, again you can change directory into an absolute path by
setting a "/" to the first character, and we can see this is where I'm in,
and then you can change directory with a relative pass by not putting the
"/". Now, additionally
another symbol in Linux is a "./" and what these two
character combinations mean, is in the current directory. So, if I remove lib here if I
just change directory into the current directory that I'm in, I will stay in the same
directory. Now, I can type cd ./lib with ./ and that's going into
the current directories next level directory called lib. So, I'm going to cd /home/nick.
Now, I could type it out like this, and this is about 10
characters, but let's say I was really lazy, you can use the "~". That's
basically, that's the key to the left of the "1" at the top of your keyboard, and
you need to hold SHIFT and press that. It's the key directly under the ESC key. This
is a "~" and this basically means home. So, it's going to take you to your home
directory, which is unique for each user. For instance, my home directory as we see here at the
top is /home/nick
because this is my username. So, we can use this a bit and put a different spin on it. Let's say
I'm in /user/share/applications, where I am right now is in this directory. We can type pwd to see the
directory that we're in. If I want to go directly to home/nick I can type cd ~ but if I wanna
go to home/nick/documents I can still use ~/documents
and this is going to put me into home/nick/documents