Key Concepts

Review core concepts you need to learn to master this subject

pwd Print Working Directory

$ pwd /Users/sonny/Downloads

The shell command pwd displays the file path from the root directory to the current working directory.

Command Line Basics
Lesson 1 of 1
  1. 1
    The command line is a text interface for your computer. It’s a program that takes in commands and passes them on to the computer’s operating system to run. From the command line, you can use c…
  2. 2
    A filesystem organizes a computer’s files and directories into a tree structure: 1. The first directory in the filesystem is the root directory. It is the parent of all other directories and fil…
  3. 3
    The first command we’re going to look at is ls. When you type ls, the command line looks at the directory you are in, and then “lists” all the files and directories inside of it. Be sure to type th…
  4. 4
    The next command we’re going to look at is pwd, which stands for “print working directory.” It outputs the name of the directory you are currently in, called the working directory. Here the w…
  5. 5
    Our next command is cd, which stands for “change directory.” Just as you would click on a folder in Windows Explorer or Finder, cd switches you into the directory you specify. In other words, cd ch…
  6. 6
    Now that we can traverse the existing filesystem, let’s try editing it by making directories (folders) through the command line. The command for that is mkdir: $ mkdir romance The mkdir command …
  7. 7
    Let’s move on to copying, moving, and removing files and directories from the command line. The cp command copies files or directories. Below, we copy the contents of a source file into a destinati…
  8. 8
    The mv command moves files. It’s similar to cp in its usage, except mv moves a file without making a copy. To move a file into a directory, use mv with the source file as the first argument and th…
  9. 9
    The rm command deletes files and directories. Here we remove the file unwanted_file.txt from the filesystem. rm unwanted_file.txt The -r is an option that modifies the behavior of the rm command….
  10. 10
    Congratulations! Using the command line, you’ve learned how to navigate and manipulate the filesystem. What can we generalize so far? * The command line is a text interface for the computer’s op…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo