This course has been updated! We now recommend you take the Full Stack for Front-End Engineers, v3 course.

Check out a free preview of the full Full Stack for Front-End Engineers, v2 course:
The "Command Line Practice" Lesson is part of the full, Full Stack for Front-End Engineers, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Jem demonstrates common commands needed to use the command line, including cd, ls, pwd, mkdir, rmdir, and man.

Get Unlimited Access Now

Transcript from the "Command Line Practice" Lesson

>> Jem Young: So let's start off with an exercise, first exercise. We're just gonna play around with the command line, just a little bit, just iin case you're comfortable. I know some of you have some Fullsac experience, which is great. Some of you have never touched the command line, other than, maybe doing Git or something like that.

[00:00:16] So, just play around with it, knowing you're probably not gonna break anything I say probably cuz I'm not at your computer, and I don't know what you're doing. I don't know if you're sitting on a couch at home watching Netflix, not really paying attention. But don't worry, I'm not gonna lead you too far astray today.

[00:00:31] The command line has, well, it's a command line. It had different commands to do things. These are some of the more familiar ones, and the ones that I use all the time. Today, we're gonna use cd a lot. That's just moving directories. Pwd is useful, it always looks like password to me, but it's print working directory.

[00:00:52] Actually, I'll just do some examples now. So, oops, execute over here. And if you want to clear you can just type clear in your command line. So if I wanna say pwd, which means I'm in slash, I'm in the root of my computer. Ls is gonna list all the files and I can say, ls, actually I'll say cd into slash etcd.

[00:01:15] Now, I'm in etc. And the back out cd1 to go nowhere, just cd1. You're probably familiar with the synod, if you want to acquire a file in the same directory, you just dot slash. Cd dot dot means move up directory. Dot dot dot means move up two directories, etc., etc.

[00:01:36] I know I'm going over the basics. That's how this day's going to go. We're going to start off really slow. So slow, you're like, why am I here? Man, this is bad idea I could have been watching, I don't know sports ball or something. But I'm, here, which we're doing these basic things.

[00:01:53] But we start off slow we will need the command line, so play around with it a bit. Cat is really useful if you wanna file you just cat a file and just print out the output. Man, we're gonna use, just because you won't know all the commands. And if you're ever curious about something we can do things like man cat and it pulls up the manual for cat.

[00:02:18] Always useful, I'll say this about man pages, are not all sunshine and roses. Everything's great in Linux land and it all makes so much sense. Man pages are not easy to read. What I recommend usually is just doing a query search, Google, Bing, whatever your preferred search engine is for the actual command you're trying to use.

[00:02:37] But for basic things using the man page just tells you what it's supposed to do and if you wanna search you can type slash and I don't know, cat. And it pulls up things. And I can, it keeps moving. And to quit, just type q. I had some jokes about man kill and all these things, but I thought they were inappropriate.

[00:03:01] No? They're not inappropriate. So kill is just a way of killing a process. And we hopefully won't do anything that requires using kill. But if you get stuck somewhere and there is a process just running how do I kill it? You start kill by process name. Pkill is useful because instead of using the idea of the thing that's running, I can just type pkill node and I don't have any node process running, but it'll kill your node process.

[00:03:29] This one I use a lot because [LAUGH] at work our node process gets hung up and it's frustrating. It's okay. If you wanna remove file, rm, pretty explanatory. Echo repeats a file or repeats an input for whatever you type in. Ls is useful, ls is like cat except cat displays everything.

[00:03:53] So if you have a one megabyte file, cat will just dump it all to your screen, which sometimes you want, sometimes you don't. Ls is like a better cat, where it only does one page at a time. So it's a bit more useful than cat, but we'll probably switch off between both.

[00:04:07] If you want to make a directory mkdir, remove directory rmdir, yeah. Is this familiar to anybody? No you've probably all seen most of this before, but it's good to kind of lay it out as a structure.