< Return to Video

Linux Tutorial - Basic Command Line

  • 0:01 - 0:03
    Hey, what's going on guys? I wanted to
  • 0:03 - 0:05
    make a video for people that are new to
  • 0:05 - 0:07
    Linux and new to the command line to
  • 0:07 - 0:09
    maybe help you out a little bit and show
  • 0:09 - 0:11
    you how to navigate the terminal and do
  • 0:11 - 0:14
    some very basic tasks. So a lot of people
  • 0:14 - 0:16
    ask me why I work on Windows in most of
  • 0:16 - 0:18
    my videos, and let me just clarify by
  • 0:18 - 0:21
    saying that I'm in no way of shape or
  • 0:21 - 0:24
    form a Windows Fanboy. I actually like
  • 0:24 - 0:25
    working on Linux better for web
  • 0:25 - 0:28
    development programming. There is a
  • 0:28 - 0:30
    few reasons why I have Windows installed
  • 0:30 - 0:34
    on my main machine. One is for the
  • 0:34 - 0:36
    recording software. I use Camtasia
  • 0:36 - 0:39
    which works flawlessly for what I need it
  • 0:39 - 0:41
    to do. And I haven't found a Linux-based
  • 0:41 - 0:43
    solution that works how I need it
  • 0:43 - 0:46
    to and processes the videos as fast
  • 0:46 - 0:49
    as I need them to. I also use Adobe
  • 0:49 - 0:51
    Photoshop and then a lot of other
  • 0:51 - 0:54
    Windows-based tools. I also have six
  • 0:54 - 0:56
    monitors, and it's a pain in the ass to
  • 0:56 - 0:58
    try and get them working with the Ubuntu
  • 0:58 - 1:01
    and working with the drivers.
  • 1:01 - 1:02
    I know I could do it if I really
  • 1:02 - 1:05
    tried, but it's just something that
  • 1:05 - 1:08
    hinders me. Another reason is gaming. I
  • 1:08 - 1:10
    have a pretty beefy system with SLI
  • 1:10 - 1:13
    graphics cards. And, obviously, if you
  • 1:13 - 1:15
    play games, you want to run Windows. Now,
  • 1:15 - 1:17
    that's not a huge deal because I very
  • 1:17 - 1:20
    rarely play games anymore because I'm so
  • 1:20 - 1:23
    busy. But that is one of the issues.
  • 1:23 - 1:25
    And then the main reason I use Windows
  • 1:25 - 1:27
    in a lot of my videos is because I'm
  • 1:27 - 1:29
    trying to reach everybody of all skill
  • 1:29 - 1:32
    sets. And chances are, a person that is
  • 1:32 - 1:34
    just learning HTML and front-end
  • 1:34 - 1:37
    development is running Windows. And they
  • 1:37 - 1:41
    may get lost if I'm using Linux or Mac.
  • 1:41 - 1:43
    Now, I know many of you do use Linux
  • 1:43 - 1:45
    or Mac, but I think that there's more of
  • 1:45 - 1:48
    a chance of a Linux or Mac user knowing
  • 1:48 - 1:50
    and understanding what I'm doing in
  • 1:50 - 1:53
    Windows than the other way around. So
  • 1:53 - 1:55
    that's probably the biggest reason. For
  • 1:55 - 1:57
    my own personal development, I do work on
  • 1:57 - 2:00
    Linux in a virtual machine. And
  • 2:00 - 2:02
    I'm going to start using Linux more in
  • 2:02 - 2:05
    my videos. So anyway, let's jump in and
  • 2:05 - 2:07
    learn some basic commands. Now, if you're
  • 2:07 - 2:09
    a Windows user I would suggest getting
  • 2:09 - 2:12
    something like VMware or VirtualBox and
  • 2:12 - 2:15
    installing a Linux distribution. You may
  • 2:15 - 2:17
    not want to go as far as to install it
  • 2:17 - 2:19
    on your main machine for your everyday
  • 2:19 - 2:21
    use, but you should get into it and start
  • 2:21 - 2:25
    to experiment with it. As far as distros, I
  • 2:25 - 2:28
    prefer Ubuntu or Debian, and there's
  • 2:28 - 2:31
    also- there's a lot to choose from, okay?
  • 2:31 - 2:33
    For beginners, I would recommend Debian,
  • 2:33 - 2:38
    Ubuntu, or even Linux Mint, openSUSE- sorry,
  • 2:38 - 2:41
    openSUSE, however you say it, is a little
  • 2:41 - 2:43
    more complicated, but I do like that as
  • 2:43 - 2:46
    well. So let's get into it.
  • 2:46 - 2:48
    Currently Ubuntu is using the Unity
  • 2:48 - 2:50
    desktop interface, but you can use a
  • 2:50 - 2:53
    different environment if you want. And
  • 2:53 - 2:55
    we're going to go and open the terminal.
  • 2:55 - 2:58
    Now, I use a program called Terminator. So
  • 2:58 - 3:00
    that's what I'm going to be using. If you
  • 3:00 - 3:02
    install Ubuntu fresh, you're going to
  • 3:02 - 3:04
    just have the regular terminal which
  • 3:04 - 3:06
    is this right here, but it doesn't really
  • 3:06 - 3:08
    matter. You use the same commands. All
  • 3:08 - 3:12
    right, so let's go ahead and just make
  • 3:12 - 3:14
    that a little bigger. Now, when you first
  • 3:14 - 3:16
    open your terminal, you're going to
  • 3:16 - 3:19
    be in your home directory, okay? Every
  • 3:19 - 3:21
    user on a Linux system has a home
  • 3:21 - 3:24
    directory, much like on Windows, if you go
  • 3:24 - 3:26
    to users, you have your usernames
  • 3:26 - 3:29
    for each account. So Linux does the same
  • 3:29 - 3:30
    thing. In fact, if we look at the file
  • 3:30 - 3:33
    manager, and you can see that actually
  • 3:33 - 3:35
    opens in the home directory as well.
  • 3:35 - 3:38
    If we go to the actual root directory,
  • 3:38 - 3:40
    it's going to be in home. And you'll see
  • 3:40 - 3:42
    I have a folder called 'brad', okay? I
  • 3:42 - 3:45
    only have one user on this system. So
  • 3:45 - 3:47
    over here, you can actually check your-
  • 3:47 - 3:50
    what path you're in with the command PWD,
  • 3:50 - 3:52
    okay? You can see I'm in home brad. So
  • 3:52 - 3:55
    that's the First Command. Now if you
  • 3:55 - 3:58
    want to show the listings like you do in
  • 3:58 - 4:00
    file manager in your command line, you
  • 4:00 - 4:03
    can use the ls, okay, the listing command.
  • 4:03 - 4:05
    And you can see that these are the same
  • 4:05 - 4:08
    folders that we're seeing here, all right?
  • 4:08 - 4:12
    Now, with commands, you also have options,
  • 4:12 - 4:14
    okay? Most commands have some options you
  • 4:14 - 4:17
    can use. Now with ls, we have an option
  • 4:17 - 4:21
    of -a. And what that does is it'll show
  • 4:21 - 4:23
    everything, even the hidden files, the
  • 4:23 - 4:25
    system files that begin with the dot,
  • 4:25 - 4:27
    it'll show those as well. By
  • 4:27 - 4:30
    default, those are hidden, okay? Much like
  • 4:30 - 4:33
    hidden files in Windows. Now we can
  • 4:33 - 4:38
    also use the -l. So if we say ls -l, and
  • 4:38 - 4:39
    that just shows us some extra
  • 4:39 - 4:42
    information. The time it was created, the
  • 4:42 - 4:45
    date, the size. Now, this here at the
  • 4:45 - 4:48
    beginning, this looks kind of weird.
  • 4:48 - 4:50
    What this is is the permissions of the
  • 4:50 - 4:52
    folder or file. Basically it's broken up
  • 4:52 - 4:55
    into three parts. The first is for the
  • 4:55 - 4:57
    owner, the permissions of the owner of
  • 4:57 - 4:59
    the folder or file. Then the permissions
  • 4:59 - 5:01
    for the group, okay, because you can also
  • 5:01 - 5:04
    have user groups and then the permission
  • 5:04 - 5:06
    for everyone else, for the rest of the
  • 5:06 - 5:08
    world, or the public. Now, these basically
  • 5:08 - 5:11
    stand for delete. The D is delete. Read,
  • 5:11 - 5:15
    write, and execute, okay? So basically the
  • 5:15 - 5:17
    owner of the folder or file has all these
  • 5:17 - 5:19
    permissions. They can do whatever they
  • 5:19 - 5:23
    want. The group can only execute and read,
  • 5:23 - 5:25
    and then the rest of the world can only
  • 5:25 - 5:27
    execute, okay? So they can't change
  • 5:27 - 5:30
    anything at all. That's what that is.
  • 5:30 - 5:32
    And then here you'll see brad brad.
  • 5:32 - 5:34
    The reason it says it twice is because
  • 5:34 - 5:36
    one is the user and then one is the
  • 5:36 - 5:39
    group, okay? So there's actually a group
  • 5:39 - 5:41
    called 'brad'.
  • 5:41 - 5:42
    And you can change these with
  • 5:42 - 5:44
    certain commands, but I'm not really
  • 5:44 - 5:46
    going to get into that today. I just want
  • 5:46 - 5:49
    to be- I want to keep things very basic.
  • 5:49 - 5:51
    So that's the ls command.
  • 5:51 - 5:53
    Now, the next command I want to
  • 5:53 - 5:56
    look at is mkdir, okay? And that is make
  • 5:56 - 5:58
    directory and it does just that. It
  • 5:58 - 6:00
    will create a directory, so let's create
  • 6:00 - 6:03
    a folder or a directory inside of our
  • 6:03 - 6:06
    home and let's call this- we'll call it
  • 6:06 - 6:09
    dir1, all right? And over here you can
  • 6:09 - 6:12
    see that now we have dir1. If we do ls,
  • 6:12 - 6:15
    you see dir1, all right? Let's create
  • 6:15 - 6:19
    another one called dir2.
  • 6:19 - 6:20
    Okay so now we have these two
  • 6:20 - 6:22
    directories. And the next command we're
  • 6:22 - 6:25
    going to look at is cd and that's change
  • 6:25 - 6:27
    directory. So if we want to go into
  • 6:27 - 6:30
    dir1, we can say CD dir1.
  • 6:30 - 6:31
    And you'll see that the prompt here
  • 6:31 - 6:34
    has now changed. It shows us where we are.
  • 6:34 - 6:37
    If we do pwd, it'll show us we're in
  • 6:37 - 6:41
    directory one, okay?
  • 6:41 - 6:43
    Now, if we want to go back one level,
  • 6:43 - 6:46
    back into the home, we can do CD space
  • 6:46 - 6:48
    dot dot. And so you can see now we're
  • 6:48 - 6:51
    back in the home, okay? If you want to
  • 6:51 - 6:53
    navigate to the absolute root of your
  • 6:53 - 6:56
    system, you could do cd and then slash.
  • 6:56 - 6:58
    And now if we do ls, you'll see we're in
  • 6:58 - 7:02
    the actual root of the entire system,
  • 7:02 - 7:04
    all right? If you want to go back home,
  • 7:04 - 7:06
    you could just do cd, and that'll bring
  • 7:06 - 7:09
    you back home. You can also do cd and
  • 7:09 - 7:12
    then this tilde, which is the key
  • 7:12 - 7:14
    that's to the left of the number one
  • 7:14 - 7:17
    key. And that basically represents
  • 7:17 - 7:19
    home. So we can do that. If we want to go
  • 7:19 - 7:22
    into dir2, let's say in the home, we
  • 7:22 - 7:24
    could do- from anywhere we could do the
  • 7:24 - 7:28
    tilde slash dir2, okay? And if we want to
  • 7:28 - 7:32
    go back out, go cd dot dot. And then let's
  • 7:32 - 7:35
    go back into dir1,
  • 7:35 - 7:37
    okay? Another helpful command is
  • 7:37 - 7:39
    clear. If we do clear, it'll just do just
  • 7:39 - 7:42
    that. It'll clear out the terminal,
  • 7:42 - 7:44
    all right? So you know how to
  • 7:44 - 7:46
    find your path. You know how to create
  • 7:46 - 7:49
    directories, how to list the contents, how
  • 7:49 - 7:53
    to change directories. That's very
  • 7:53 - 7:55
    basic. Now what we're going to do is
  • 7:55 - 7:56
    I'm going to show you how to create a
  • 7:56 - 7:59
    file. So let's say we want to create a
  • 7:59 - 8:00
    text file.
  • 8:00 - 8:03
    We could use the touch command. So we say
  • 8:03 - 8:07
    touch, we'll say file one dot text. And now
  • 8:07 - 8:10
    if we do an ls, you can see we have that
  • 8:10 - 8:13
    file one. Now, if we want to edit that
  • 8:13 - 8:15
    file, of course, you could do that from
  • 8:15 - 8:17
    within your file manager. So you could
  • 8:17 - 8:20
    just go to file one dot text, and I think,
  • 8:20 - 8:22
    yeah, it'll open with gedit if you open
  • 8:22 - 8:26
    it here. But you can also use command
  • 8:26 - 8:29
    based- command line-based text editors. So
  • 8:29 - 8:32
    the one that I would recommend for
  • 8:32 - 8:35
    for beginners is Nano, okay? It's very
  • 8:35 - 8:39
    easy to use. Now if we say Nano
  • 8:39 - 8:41
    file one dot text, it's going to bring
  • 8:41 - 8:43
    us into a screen like this. So this is
  • 8:43 - 8:47
    the Nano editor. And like I said, it's
  • 8:47 - 8:49
    pretty easy to use. Basically we could
  • 8:49 - 8:52
    just- let's just say hello world,
  • 8:52 - 8:55
    okay? Now, if we wanted to exit out, we
  • 8:55 - 8:58
    want to do a control 'x', and then it's going
  • 8:58 - 9:01
    to ask if we want to to save or not, okay?
  • 9:01 - 9:03
    So we're going to say y for yes and then
  • 9:03 - 9:06
    enter, and then that will edit the file
  • 9:06 - 9:10
    and save it, okay? So control 'x' to escape,
  • 9:10 - 9:13
    yes or no to save,
  • 9:13 - 9:14
    okay? And you won't get prompted if
  • 9:14 - 9:16
    you don't edit it at all, you won't get
  • 9:16 - 9:20
    prompted to save or not. Now, you can also
  • 9:20 - 9:22
    use the cat command to see what's in a
  • 9:22 - 9:28
    file. So we'll say cat file1.txt, and
  • 9:28 - 9:31
    it'll show us what's in it.
  • 9:31 - 9:32
    It basically takes the input and puts
  • 9:32 - 9:35
    it to standard output, which is what's
  • 9:35 - 9:37
    shown here. Now, if this is a really,
  • 9:37 - 9:40
    really long file and you have to page
  • 9:40 - 9:43
    down, you can use less instead of cat. So
  • 9:43 - 9:44
    file one
  • 9:44 - 9:47
    dot text, and you could- you'd be able to
  • 9:47 - 9:50
    page down, okay, and see the whole file.
  • 9:50 - 9:52
    And then to get out of it, you just want
  • 9:52 - 9:55
    to hit 'q' and that'll quit, okay? So that's
  • 9:55 - 9:57
    cat and less.
  • 9:58 - 10:00
    Now, let's say we want to rename
  • 10:00 - 10:03
    this file, okay? So there's a command to
  • 10:03 - 10:06
    move files and rename, and that's mv. So
  • 10:06 - 10:09
    if we say mv file1.txt
  • 10:09 - 10:15
    and space file2.txt,
  • 10:15 - 10:17
    okay? And then we do an ls. You can see
  • 10:17 - 10:20
    that file1 has now been renamed to
  • 10:20 - 10:23
    file2. And if we say cat
  • 10:23 - 10:27
    file2.txt, you can see it's the hello
  • 10:27 - 10:29
    world.
  • 10:29 - 10:32
    Now, we can also copy files. So let's say
  • 10:32 - 10:35
    we want to take file2 and create file1,
  • 10:35 - 10:37
    but also keep file2, then we could
  • 10:37 - 10:41
    do cp, okay? That's the copy command.
  • 10:41 - 10:47
    File2.txt and we want to copy it to file1.txt.
  • 10:47 - 10:48
    And now if we look at the
  • 10:48 - 10:51
    contents, we have both files. And if we
  • 10:51 - 10:54
    say cat file1,
  • 10:54 - 10:57
    hello world, okay? So let's clear this
  • 10:57 - 10:58
    out.
  • 11:00 - 11:02
    Now, we can move and copy to other
  • 11:02 - 11:05
    locations as well. So if we want to, let's
  • 11:05 - 11:10
    say, copy file1.txt, we want to copy it
  • 11:10 - 11:14
    to, let's say, tilde for the home
  • 11:14 - 11:15
    and then slash
  • 11:15 - 11:18
    dir2 slash
  • 11:18 - 11:22
    file1.txt,
  • 11:22 - 11:24
    Okay, and then we'll switch directories.
  • 11:24 - 11:25
    Let's say
  • 11:25 - 11:30
    cd dot dot and then cd dir2.
  • 11:30 - 11:36
    Whoop, cd dir2 and ls. And there's the file
  • 11:36 - 11:38
    one, okay? So we can do that as
  • 11:38 - 11:42
    well. Now, if you want to delete a file or
  • 11:42 - 11:46
    remove a file, you can use the rm command.
  • 11:46 - 11:48
    Okay, so let's say we want to delete
  • 11:48 - 11:53
    file one. We can say rm file1.txt.
  • 11:53 - 11:56
    And now if we look, now it's gone, all
  • 11:56 - 11:58
    right? Now, if you want to remove a
  • 11:58 - 12:03
    directory, let's go out to our home, and
  • 12:03 - 12:05
    let's say we want to remove directory 2,
  • 12:05 - 12:08
    we can do rmdir
  • 12:08 - 12:11
    dir2, okay? So now if we do
  • 12:11 - 12:16
    ls. Directory 2 is now gone. Now I'm going
  • 12:16 - 12:17
    to put it back. We're going to make
  • 12:17 - 12:20
    directory dir2, and then I'm going to go
  • 12:20 - 12:23
    into it,
  • 12:23 - 12:26
    and I'm going to create a file.
  • 12:26 - 12:29
    So touch file1.txt, and I'm going to
  • 12:29 - 12:32
    go back out to my route, and I'm going to
  • 12:32 - 12:36
    try to delete dir2.
  • 12:36 - 12:37
    And now you see it says failed to
  • 12:37 - 12:41
    remove dir2. Directory is not empty. So
  • 12:41 - 12:43
    this command isn't going to work if the
  • 12:43 - 12:46
    directory is empty. If it has
  • 12:46 - 12:47
    files in it and you want to delete it,
  • 12:47 - 12:51
    you want to use rm, but if you just do rm
  • 12:51 - 12:53
    dir2, it'll say can't remove it. So you
  • 12:53 - 12:57
    need to add the dash capital r option
  • 12:57 - 13:01
    which is for recursive. So you want to do
  • 13:01 - 13:06
    rm -R and then dir2. And now if we do
  • 13:06 - 13:08
    an ls, dir2 is gone as well as all the
  • 13:08 - 13:11
    files that are in it.
  • 13:11 - 13:13
    So let's clear that out. And then the
  • 13:13 - 13:16
    next command I want to look at is which.
  • 13:16 - 13:19
    So what which does is it'll search for
  • 13:19 - 13:22
    a file or a folder's location and
  • 13:22 - 13:24
    give you that location. So let's
  • 13:24 - 13:27
    say we want to look for the mongoD
  • 13:27 - 13:29
    application, which is the mongodDB
  • 13:29 - 13:33
    server. We could say which mongod, and
  • 13:33 - 13:35
    that'll show you exactly where it's in.
  • 13:35 - 13:41
    It's in the usr, bin, mongod. Okay, so
  • 13:41 - 13:44
    that can come in pretty handy.
  • 13:44 - 13:47
    So what else? Let's say let's
  • 13:47 - 13:50
    use the history command. And history will
  • 13:50 - 13:53
    basically show you your last, what is
  • 13:53 - 13:57
    it? 500 or so, 400? Well, I think it's your
  • 13:57 - 14:00
    last 500 commands.
  • 14:00 - 14:02
    Okay, so that can be handy to see
  • 14:02 - 14:05
    what you've been doing or to see what
  • 14:05 - 14:08
    someone else has been doing.
  • 14:08 - 14:09
    Let's see, what else? So we've
  • 14:09 - 14:11
    went over pretty much all the basics of,
  • 14:11 - 14:13
    you know, moving files and folders around
  • 14:13 - 14:16
    and deleting them and renaming them. So
  • 14:16 - 14:17
    those are the most important. Those
  • 14:17 - 14:20
    are the things that you absolutely need
  • 14:20 - 14:23
    to know. Now, some things you can't run
  • 14:23 - 14:25
    as your user- you have to run it as the
  • 14:25 - 14:28
    root user. And you never want to be
  • 14:28 - 14:30
    really, you know, messing around with stuff
  • 14:30 - 14:32
    logged in as the root user. So
  • 14:32 - 14:35
    for that, you could use sudo. So let's
  • 14:35 - 14:39
    try to run, for instance, apt get update,
  • 14:39 - 14:41
    which I'll go over in a minute. It's
  • 14:41 - 14:43
    not going to let us. Basically it says
  • 14:43 - 14:46
    that we don't have the permission to. So
  • 14:46 - 14:46
    if we do
  • 14:46 - 14:51
    sudo apt get update, it's going to ask
  • 14:51 - 14:54
    for our password,
  • 14:54 - 14:57
    and then it'll run it, okay?
  • 14:57 - 14:59
    And that's just updating our packages,
  • 14:59 - 15:02
    and I'll get to that in a second. So
  • 15:02 - 15:04
    you want to use sudo to run as
  • 15:04 - 15:07
    root. Let's clear this out.
  • 15:07 - 15:09
    Now, let's look at some system
  • 15:09 - 15:11
    commands. So these are- you don't need
  • 15:11 - 15:13
    these to be able to navigate or
  • 15:13 - 15:15
    anything, but they're good to know. So
  • 15:15 - 15:18
    first one is ifconfig,
  • 15:18 - 15:20
    and this is just like ipconfig
  • 15:20 - 15:22
    on Windows. It basically it's going to
  • 15:22 - 15:24
    give you all your network information,
  • 15:24 - 15:28
    your ethernet cards, your IP address,
  • 15:28 - 15:30
    your local IP address, your loop back,
  • 15:30 - 15:34
    things like that. Pretty much
  • 15:34 - 15:36
    identical to ipconfig in Windows if
  • 15:36 - 15:38
    you've ever used that. For wireless, you
  • 15:38 - 15:41
    can do iwconfig.
  • 15:41 - 15:42
    And that's going to show you- I
  • 15:42 - 15:44
    don't have any wireless on this machine,
  • 15:44 - 15:46
    but if you did, it would show you that
  • 15:46 - 15:49
    stuff, okay? Now, if you want
  • 15:49 - 15:55
    to ping another machine or over the
  • 15:55 - 15:56
    either over the Internet or on your
  • 15:56 - 15:58
    local network, you could say ping, for
  • 15:58 - 15:59
    instance, let's say
  • 15:59 - 16:02
    google.com to see if that's online. You
  • 16:02 - 16:04
    can see we're getting a
  • 16:04 - 16:07
    response back from our request, okay? And
  • 16:07 - 16:08
    it's just going to keep going like this,
  • 16:08 - 16:10
    but if you want to stop it, you can do a
  • 16:10 - 16:13
    control 'c', okay? So if we try to ping
  • 16:13 - 16:17
    something that's most likely not a
  • 16:17 - 16:20
    domain, you'll see we get unknown host,
  • 16:20 - 16:21
    okay? So that's how you can tell if
  • 16:21 - 16:23
    you can actually reach a certain machine
  • 16:23 - 16:26
    or not, okay? So let's look at some other
  • 16:26 - 16:29
    system commands. Let's see, we have
  • 16:29 - 16:32
    uname. Let's do uname -a. That's going
  • 16:32 - 16:34
    to just basically give us a summary of
  • 16:34 - 16:36
    our system, the operating system, the
  • 16:36 - 16:40
    version, things like that, okay? We also
  • 16:40 - 16:43
    have- let's do
  • 16:43 - 16:46
    bld. I'm sorry,
  • 16:46 - 16:51
    blkid, and what that does is it basically
  • 16:51 - 16:55
    shows us our hard drive. So I have a
  • 16:55 - 16:57
    my regular hard drive and then
  • 16:57 - 17:00
    what's called a swap, okay? So when Linux
  • 17:00 - 17:02
    partitions your drive, it puts a
  • 17:02 - 17:06
    little bit aside for a swap file here.
  • 17:06 - 17:08
    Let's see, what else? If we do top,
  • 17:08 - 17:10
    that's another command. That's basically
  • 17:10 - 17:14
    going to show us our processes and
  • 17:14 - 17:16
    how much memory and CPU they're taking up,
  • 17:16 - 17:18
    things like that. Kind of like the
  • 17:18 - 17:21
    the Task Manager in Windows, even though
  • 17:21 - 17:24
    there is a System Monitor
  • 17:24 - 17:25
    right here that you can use in
  • 17:25 - 17:28
    Linux as well, and that'll show you
  • 17:28 - 17:30
    resources, stuff like that, the running
  • 17:30 - 17:34
    processes, okay? And to get out of this,
  • 17:34 - 17:36
    you just want to hit 'q'.
  • 17:38 - 17:39
    Let's see, what else? What else did I
  • 17:39 - 17:42
    want to do? Df is another command.
  • 17:42 - 17:45
    That'll show us our available and
  • 17:45 - 17:49
    unavailable disk space. We have lsusb
  • 17:49 - 17:52
    which will show devices like USB hubs,
  • 17:52 - 17:56
    things like that. For PCI stuff, you
  • 17:56 - 17:59
    can use ls pci, and that'll show you
  • 17:59 - 18:02
    all that crap, a lot of which I don't
  • 18:02 - 18:06
    even understand, but it's available to you.
  • 18:06 - 18:08
    Let's see, I think that's
  • 18:08 - 18:10
    pretty much it.
  • 18:10 - 18:13
    Oh, package managers. Package managers
  • 18:13 - 18:16
    are a big part of most Linux
  • 18:16 - 18:18
    distributions. Different distributions
  • 18:18 - 18:21
    use different managers. Debian and Ubuntu uses
  • 18:21 - 18:23
    apt get. So we can say
  • 18:23 - 18:28
    sudo apt get and then install, and then
  • 18:28 - 18:29
    we can install any package that's
  • 18:29 - 18:31
    available. So let's say we want to
  • 18:31 - 18:35
    install filezilla, which is an FTP client,
  • 18:35 - 18:37
    okay? So as long as it's available, it'll
  • 18:37 - 18:39
    go ahead and install that for us on our
  • 18:39 - 18:42
    system, all right? And now if we go to up
  • 18:42 - 18:46
    here and we search for filezilla, there
  • 18:46 - 18:48
    it is, okay? And we can move it over here if
  • 18:48 - 18:51
    we want, and it's as easy as that,
  • 18:51 - 18:53
    which is much easier than in, you know,
  • 18:53 - 18:55
    in Windows having to go to the site,
  • 18:55 - 18:57
    download it, go through the installer.
  • 18:57 - 19:00
    This is one of the the best reasons to
  • 19:00 - 19:02
    use Linux. Now, if we want to get rid
  • 19:02 - 19:04
    of it, we could simply do
  • 19:04 - 19:07
    sudo apt get
  • 19:07 - 19:09
    remove
  • 19:09 - 19:14
    filezilla. And that will- we'll say yes.
  • 19:14 - 19:16
    And that will remove it. You can see
  • 19:16 - 19:18
    it just disappeared, okay? Now, if you
  • 19:18 - 19:21
    want to update or see if there's
  • 19:21 - 19:24
    available updates for packages on
  • 19:24 - 19:25
    your system, you can do
  • 19:25 - 19:29
    sudo apt get update. And it'll run
  • 19:29 - 19:31
    through and check everything,
  • 19:31 - 19:35
    and if it finds something, it'll let
  • 19:35 - 19:38
    you know.
  • 19:39 - 19:41
    So I think that's pretty much it
  • 19:41 - 19:44
    guys. I don't want to get too deep
  • 19:44 - 19:46
    into anything here. This is meant to be
  • 19:46 - 19:49
    just for, you know, a beginner guide. Oh,
  • 19:49 - 19:51
    we also have the shutdown command. We
  • 19:51 - 19:52
    could say sudo
  • 19:52 - 19:55
    shutdown. And if you wanted to restart,
  • 19:55 - 19:57
    you could do a -r, but I'm going to
  • 19:57 - 19:59
    halt, shut the whole thing down. So I'm going to
  • 19:59 - 20:01
    do -h, and then you could also set a
  • 20:01 - 20:03
    time if you wanted to do like 10 minutes,
  • 20:03 - 20:05
    you could do that. But I'm just going to
  • 20:05 - 20:06
    do now,
  • 20:06 - 20:08
    okay? And it's going to go ahead and
  • 20:08 - 20:11
    shut down. So hopefully you guys enjoyed
  • 20:11 - 20:14
    this. And if you did and you're not
  • 20:14 - 20:17
    subscribed, please do so if you feel
  • 20:17 - 20:20
    like it. If you liked it, leave a like.
  • 20:20 - 20:22
    If you didn't, you can leave a dislike.
  • 20:22 - 20:26
    And that's it! Thanks for watching.
Title:
Linux Tutorial - Basic Command Line
Description:

more » « less
Video Language:
English
Duration:
20:24

English subtitles

Revisions Compare revisions