WDI Fundamentals

WDI Fundamentals Unit 6


Command Line Cheat Sheet

Command Line

  • A text-based interface.
  • Synonyms: command line interface (CLI) console

Terminal

  • An OS X application that provides text-based access to a computer's operating system.
  • Any device or application used for data entry and display in a computer system.
  • Synonyms: client, computer terminal, terminal emulator

File System

  • A file system is a systematic way to control how information is stored and retrieved on a computer. It describes where one piece of information stops and the next one begins. Each file system has its own structure and logic.
  • Synonyms: NTFS (Windows' File System), HFS+ (Apple's File System), file allocation table, GFS (Global File System)

Directory

  • A unit, or container, used to organize computer files into a hierarchical structure.
  • Synonyms: folder, catalog, drawer

Path

  • A sequence of symbols and names that identifies a file or directory. The path always starts from your working directory or from the root directory, and each sub-directory is followed by a forward slash.
  • An absolute, or full, path begins with the root directory and specifies every directory above the terminating file or directory name.
  • A relative path does not include the root or parent directory names and refers to a file or directory directly below the current working directory.
  • Synonyms: path name

Command

  • The action we want the computer to take; always a single word.
  • Synonyms: utility

Option

  • Follows the "command" in a command line; used to modify the behavior of the command in some way.
  • Synonyms: flag

Argument

  • Follows the "command" and "options" (if any) in a command line and is used to explain what we want the command to act upon.
  • The number of arguments used generally depends on the command; some don't need arguments, some require exactly one argument, some require many arguments, and some are flexible in the number they can take.
Command Description
pwd -options Prints the working directory; returns the absolute path name of the current directory
ls [-options] [path/to/directory] Lists directory contents
cd [-options] [path/to/directory] Changes the current working directory to the specified directory
mkdir [-options] [path/to/directory] Makes a new directory
rm -r [path/to/file] [path/to/file] ... Removes directories or files permanently
mv [-options] [path/to/file] [path/to/directory] Moves directories or files to a new locale
mv [-options] [path/to/file] [NEW_FILE_NAME] Renames a file or directory

On Mac, your terminal comes with a manual. To access more (a lot more) information about any command, type man, followed by the command name, and press Enter:

manual

You can scroll through a manual entry using the arrow keys or space bar. To quit this view and return to your prompt, type q.


Feeling confident? Let's take what we've learned and apply it to a project.