-
hey what's going on guys I wanted to
-
make a video for people that are new to
-
Linux and new to the command line to
-
maybe help you out a little bit and show
-
you how to navigate the terminal and do
-
some very basic tasks so a lot of people
-
ask me why I work on Windows in most of
-
my videos and let me just clarify by
-
saying that I'm in no way a shape or
-
form a Windows Fanboy um I actually like
-
working on Linux better for web
-
development programming um there is a
-
few reasons why I have Windows install
-
on my main machine one is for the
-
recording software um I use Camtasia
-
which works flawlessly for what I needed
-
to do and I I haven't found a Linux
-
based solution that works how I needed
-
to and processes the videos um as fast
-
as I need them to um I also use Adobe
-
Photoshop uh and then a lot of other
-
windows-based tools I also have six
-
monitors and it's a pain in the ass to
-
try and get them working with the buntu
-
and working with the the drivers
-
um I know I I could do it if I really
-
tried but uh it's just something that
-
hinders me um another reason is gaming I
-
have a pretty beefy system with SLI
-
graphics cards and um obviously if you
-
play games you want to run Windows now
-
that's not a huge deal because I very
-
rarely play games anymore because I'm so
-
busy um but that is is one of the issues
-
and then the main reason I use Windows
-
in a lot of my videos is because I'm
-
trying to reach everybody of all skill
-
sets and chances are a person that is
-
just learning HTML and front-end
-
development is running Windows and they
-
may get lost if I I'm using Linux or Mac
-
um now I know many of you do use Linux
-
or Mac but I think that there's more of
-
a chance of a Linux or Mac User knowing
-
and understanding what I'm doing in
-
Windows uh than the other way around so
-
that's probably the biggest reason for
-
my own personal development I do work on
-
Linux in a in a virtual machine and and
-
I'm going to start using Linux more in
-
my videos so anyway let's jump in and
-
learn some basic commands now if you're
-
a Windows user I would suggest getting
-
something like VMware or virtual box and
-
installing a Linux distribution you may
-
not want to go as far as to install it
-
on your main machine for your everyday
-
use but you should get into it and start
-
to experiment with it as far as dros I
-
prefer auntu uh or Debian uh and there's
-
also there's a lot to choose from okay
-
for beginners I would recommend Debbie
-
and auntu or even Linux Mint um Opus or
-
open Sous however you say it is a little
-
more complicated but I do like that as
-
well um so uh let's get into it
-
currently auntu is using the unity
-
desktop interface but you can use a
-
different environment if you want um and
-
we're going to go and open the terminal
-
now I use a program called Terminator so
-
that's what I'm going to be using if you
-
install a bunch to Fresh you're going to
-
just have the the regular terminal which
-
is this right here but it doesn't really
-
matter you use the same commands all
-
right so let's go ahead and just make
-
that a little bigger now when you first
-
open your terminal the you're going to
-
be in your home directory okay every
-
user on a Linux system has a home
-
directory much like on Windows if you go
-
to users you have your your usernames
-
for each account so Linux does the same
-
thing in fact if you look the file
-
manager and you can see that actually
-
opens in the home directory as well uh
-
if we go to the actual root directory
-
it's going to be in home and you'll see
-
I have a a folder called Brad okay I
-
only have one user on this system um so
-
over here you can actually check your
-
what path you're in with the command
-
PWD okay you can see I'm in home Brad so
-
that's the First Command um now if you
-
want to show the listings like you do in
-
file manager in your command line you
-
can use the ls okay the listing command
-
and you can see that these are the same
-
folders that we're seeing here all right
-
now with commands you also have options
-
okay most commands have some options you
-
can use now with ls we have an option
-
of- A and what that does is it'll show
-
everything even the hidden files the
-
system files that begin with the dot
-
they'll it'll show those as well by
-
default those are hidden okay much like
-
hidden files in Windows um now we can
-
also use the DL so if we say ls- l and
-
that just shows us some extra
-
information the time it was created the
-
date the size now this here at the
-
beginning this looks kind of weird um
-
what this is is the permissions of the
-
folder or file basically it's broken up
-
into three parts the first is for the
-
owner the permissions of the owner of
-
the folder or file then the permissions
-
for the group okay because you can also
-
have user groups and then the permission
-
for everyone else for the rest of the
-
world or the public now these basically
-
stand for delete the D is delete read
-
write and execute okay so basically the
-
owner of the folder file has all these
-
permissions they can do whatever they
-
want the group can only execute and read
-
and then the rest of the world can only
-
execute okay so they can't change
-
anything at all uh that's what that is
-
uh and then here you'll see Brad Brad
-
the reason it says it twice is because
-
one is the user and then one is the
-
group okay so there's actually a group
-
called
-
Brad uh and you can change these with
-
certain commands but I'm not really
-
going to get into that today I just want
-
to be I want to keep things very basic
-
so that's the ls
-
command now the next command I want to
-
look at is mkdir okay and that is make
-
directory and that does just that it
-
will create a directory so let's create
-
a folder or a directory inside of our
-
home and let's call this we'll call it
-
dur one all right and over here you can
-
see that now we have dur one if we do LS
-
you see dur one all right let's create
-
another one called dur
-
2 okay so now we have these two
-
directories and the next command we're
-
going to look at is CD and that's change
-
directory so if we want to go into
-
durwan we can say CD
-
one and you'll see that the prompt here
-
is now changed it shows us where we are
-
uh if we do PWD it'll show us we're in
-
directory one
-
okay now if we want to go back one level
-
back into the home we can do CD space
-
dot dot and so you can see now we're
-
back in the home okay if you want to
-
navigate to the absolute root of your
-
system you could do CD and then slash
-
and now if we do LS you'll see we're in
-
the the actual root of the entire system
-
all right um if you want to go back home
-
you could just do CD and that'll bring
-
you back home um you can also do CD and
-
then this this tild which is the the key
-
that's to the left of the the number one
-
key and that basically rep represents
-
home so we can do that if we want to go
-
into dur 2 let's say in the home we
-
could do from anywhere we could do the
-
till day SL dur 2 okay and if we want to
-
go back out go CD do Dot and then let's
-
go back into dur
-
one okay another helpful command is
-
clear if we do clear it'll just do just
-
that it'll clear out the
-
terminal all right so you know how to
-
find your path you know how to create
-
directories how to list the contents how
-
to change directories um that's very
-
basic uh now what we're going to do is
-
I'm going to show you how to create a
-
file so let's say we want to create a a
-
text file
-
we could use the touch command so we say
-
touch we'll say file one. text and now
-
if we do an LS you can see we have that
-
file one now if we want to edit that
-
file of course you could do that from
-
within your file manager so you could
-
just go to file one. text and I think
-
yeah it'll open with gedit if you open
-
it here um but you can also use command
-
based command line based text editors so
-
the one that I would recommend for um
-
for beginners is nano okay it's very
-
easy to use now if we say
-
Nano file one. text it's going to bring
-
us into a screen like this so this is
-
the Nano editor and um like I said it's
-
pretty easy to use uh basically we could
-
just uh let's just say hello
-
world okay now if we want to exit out we
-
want to do a contr x and then it's going
-
to ask if we want to to save or not okay
-
so we're going to say y for yes and then
-
enter and then that will edit the file
-
and save it okay so contrl X to escape
-
yes or no to
-
save okay and you won't get prompted if
-
you don't edit it at all you won't get
-
prompted to save or not now you can also
-
use the cat command to see what's in a
-
file so we'll say cat file1.txt and
-
it'll show us what's in it
-
um it basically takes the input and puts
-
it to standard output which is what's
-
shown here um now if this is a really
-
really long file and you have to page
-
down you can use less instead of cat so
-
file
-
one. text and you could you'd be able to
-
page down okay and see the whole file
-
and then to get out of it you just want
-
to hit q and that'll quit Okay so that's
-
cat and
-
less now let's say we want to to rename
-
this file okay so there's a command to
-
move files and rename and that's MV so
-
if we say MV file1.txt
-
and space file
-
2.txt
-
okay and then we do an LS you can see
-
that uh file one has now been renamed to
-
file two and if we say cat
-
file2.txt you can see it's the hello
-
world
-
now we can also copy files so let's say
-
we want to take file two and create file
-
one but also keep file two then we could
-
do CP okay that's the copy command file
-
2.txt and we want to copy it to file
-
one.txt and now if we look at the
-
contents we have both files and if we
-
say cat file
-
one hello world okay so let's clear this
-
out
-
now we can move and copy to other
-
locations as well so if we want to let's
-
say copy file one.txt we want to copy it
-
to let's say um till day for the home
-
and then slash
-
dir2 SL
-
file1.txt
-
okay and then we'll switch directories
-
let's say
-
CD dot dot and then CD dir2
-
wh CD dur 2 and LS and there's the file
-
one okay so we can do that as
-
well now if you want to delete a file or
-
remove a file you can use the RM command
-
say Okay so let's say we want to delete
-
file one we can say RM file1.txt
-
and now if we look now it's gone all
-
right now if you want to remove a
-
directory let's go out to our home and
-
let's say we want to remove directory 2
-
we can do
-
rmd dur 2 okay so now if we do
-
LS directory 2 is now gone now I'm going
-
to put it back we're going to make
-
directory dir 2 and then I'm going to go
-
into
-
it and I'm going to create a
-
file so touch file1.txt and I'm going to
-
go back out to my rout and I'm going to
-
try to
-
delete dir
-
2 and now you see it says failed to
-
remove dir 2 directory is not empty so
-
this command isn't going to work if the
-
directory is empty if it's if it has
-
files in it and you want to delete it
-
you want to use RM but if you just do RM
-
dir2 it'll say can't remove it so you
-
need to add the dash capital r uh option
-
which is for recursive so you want to do
-
um rm- R and then dir 2 and now if we do
-
an LS dir2 is gone as well as all the
-
files that are in
-
it so let's clear that out and then the
-
next command I want to look at is which
-
so what witch does is it'll search for
-
um a a file or a folder's location and
-
give you that location so uh let's see
-
say we want to look for the mongod d uh
-
application which is the the mongod DB
-
server we could say which mongod D and
-
that'll show you exactly where it's in
-
it's in the the USR bin mongod D okay so
-
um that can come in pretty
-
handy uh so what else let's say let's
-
use the history command and history will
-
basically show you your last uh what is
-
it 500 or so 400 well I think it's your
-
last 500 commands
-
okay so that's that can be handy see
-
what you've been doing um or to see what
-
someone else has been
-
doing let's see what else so we we've
-
went over pretty much all the basics of
-
you know moving files and folders around
-
and deleting them and renaming them so
-
those those are the most important those
-
are the things that you absolutely need
-
to know um now some things you can't run
-
as your user you have to run it as the
-
root user and you never want to be
-
really you know mess around with stuff
-
logged in as the the the root user so
-
for that you could use pseudo so let's
-
try to run for instance app get update
-
which I'll go over in a minute um it's
-
not going to let us basically it says
-
that we don't have the permission to so
-
if we do
-
pseudo app get update it's going to ask
-
for our
-
password and then it'll run it okay uh
-
and that's just updating our packages
-
and I'll get to that in a second um so
-
you want to use pseudo to run run as
-
root let's clear this
-
out now let's look at some system
-
commands so these are you don't need
-
these to be able to to navigate or
-
anything but uh they're good to know so
-
first one is if
-
config and this is just like ip config
-
on Windows it basically it's going to
-
give you all your network information
-
your ethernet cards um your IP address
-
your local IP address um your loop back
-
things like that um pretty much
-
identical to IP config in Windows if
-
you've ever used that for wireless you
-
can do IW
-
config and that's going to show you I
-
don't have any Wireless on this machine
-
but if you did it would show you that
-
stuff okay um now if you want
-
to Ping another machine or uh over the
-
either over the Internet or on your
-
local network you could say ping for
-
instance let's say
-
google.com to see if that's online you
-
can see we're getting a we're getting a
-
response back from our request okay and
-
it's just going to keep going like this
-
but if you want to stop it you can do a
-
contrl c okay so if we try to Ping
-
something that's most likely not a
-
domain you'll see we get unknown host
-
okay so that's how you can tell if if
-
you can actually reach a certain machine
-
or not okay so let's look at some other
-
system commands um let's see we have
-
uname let's do un name- a that's going
-
to just basically give us a summary of
-
our system the operating system the
-
version uh things like that okay we also
-
have uh let's
-
do
-
BL uh BL I'm sorry
-
Blk and what that does is it basically
-
shows us our hard drive so I have a um
-
an uh my regular hard drive and then
-
what's called a swap okay so when Linux
-
partitions your drive it it puts a
-
little bit aside for a swap file here
-
um let's see what else if we do top
-
that's another command that's basically
-
going to show us our processes and um
-
how much memory and CPU they're taking
-
up things like that um kind of like the
-
the Task Manager in Windows even though
-
there is a a system
-
monitor right here that you can use in
-
Linux as well and that'll show you
-
resources stuff like that the running
-
processes okay and to get out of this
-
you just want to hit
-
Q let's see what else what else did I
-
want to do uh DF is another command
-
that'll show us our um available and
-
unavailable dis space we have lsusb
-
which will show devices like USB hubs
-
things like that um for PCI stuff you
-
can use LS PCI and that'll I'll show you
-
all that crap uh a lot of which I don't
-
even understand but it's available to
-
you um let's see I think that's that's
-
pretty much
-
it oh package managers packages managers
-
are are a big part of of most Linux
-
distributions um different distributions
-
use different managers Debbie auntu uses
-
apt get so we can say
-
pseudo apt get and then install and then
-
we can install any package that's
-
available so let's say we want to
-
install filezilla which is an FTP client
-
okay so as long as it's available it'll
-
go ahead and install that for us on our
-
system all right and now if we go to up
-
here and we search for filezilla there
-
it is okay we can move it over here if
-
we want and it's as easy as that um
-
which is much easier than in in you know
-
in Windows having to go to the site
-
download it go through the installer um
-
this is one of the the best reasons to
-
use Linux um now if we want to get rid
-
of it we could simply do
-
pseudo AP get
-
remove
-
filezilla and that will we'll say
-
yes and that will remove it you can see
-
it just disappeared okay um now if you
-
want to update or see if there's
-
available updates for um packages on
-
your system you can do
-
pseudo appt get update and it'll run
-
through and check everything um
-
and uh if it finds something it'll let
-
you
-
know so I think that's pretty much it
-
guys um I don't want to get too deep
-
into anything here this is meant to be
-
just for you know a beginner guide um oh
-
we also have the shutdown command we
-
could say pseudo
-
shutdown and if you wanted to restart
-
you could do a dasr but I'm going to
-
Halt shut the whole thing down so I'm to
-
do Dash and then you could also set a
-
time if you wanted to do like 10 minutes
-
you could do that but I'm just going to
-
do
-
now okay and it's going to go ahead and
-
shut down so hopefully you guys enjoyed
-
this and um if you did and you're not
-
subscribe please do so if if you feel
-
like it uh if you liked it leave a like
-
if you didn't you can leave a dislike
-
and that's it thanks for watching