Define the following terms, and give an example of each.
command
flag / option
argument
prompt
pathname
path separator
Definitions Continued
commands are verbs; they tell the computer to do something. ex. ls
flags are like adverbs; they specify how a command is run. ex. the -l flag in ls -l
arguments are the thing or things that a command acts on; they’re like nouns (or more formally, direct objects). ex. Desktop in ls Desktop
the prompt is the symbol (or symbols) that appear in your terminal indicating that the computer is waiting for input
a pathname is the general form of the name of a file or directory; it specifies a unique location in a file system. ex. /Users/student/Desktop
a path separator is a character that’s used to join together each directory in a pathname. ex. /
OSX Directory Structure
What is the top most folder on a disk (the directory that contains all of the other files and directories) called?
root or /
What is the full path to the student user’s “Home” folder?
/Users/student or ~
OSX Directory Structure
What is the full path to the student user’s “Desktop”?
/Users/student/Desktop
What directory contains all of the disks (USB drives, SSDs, etc.) that are attached to your computer?
/Volumes
OSX Directory Structure Continued
/ - (also called root) the top most folder on a disk (the directory that contains all of the other files and directories)
/Applications - where shared applications are kept
/Users - all user accounts and their accompanying files are stored here
/Volumes - all disks that are attached to your computer including USB drives, hard drives, etc.
/System - system specific files, libraries, preferences that are critical to the operating system
Within the User’s Directory
/Users/username - (also called home when you’re in your own username’s directory) contains files specific to that particular user
/Users/username/Desktop - represents the user’s Desktop
/Users/username/Downloads - the user’s downloads folder
/Users/username/Documents - the user’s documents folder
Navigating the File System
List all of the commands that we know as well as what they do… →
pwd - print working directory
hostname - display name of computer
mkdir - make a directory
cd - change directory
ls - list contents of current directory
rmdir - remove a directory
pushd - save current directory
popd - go to most recent saved directory
About ls
Does ls take any arguments or flags? If so, what are they? →
ls optionally takes one argument - the directory that you’d like to list files in. ex. shows all files on your desktop - ls ~/Desktop
-l - show detailed (long) listing
-a - display all files, even hidden files
-t - sort listing by time
About mkdir
Does mkdir take any arguments or flags? If so, what are they? →
mkdir requires one argument - the directory that you’re creating
-p - create each nested directory in the pathname specified as the argument. ex. this creates three directories nested within eachother - mkdir foo/bar/baz
Some Special Symbols for Paths
Name some special symbols that we know for paths… like current directory or home. →
. (dot) - the current directory
.. (dot dot) - up one directory (parent directory)
../.. (dot dot slash dot dot) - up two directories
/ (slash) - root directory
~ (tilde) - home directory
- (dash) - directory you were previously in
Making Things Easier…
Name some special keys that we use to reduce the amount of typing that we have to do. →
<TAB> - autocomplete
<TAB><TAB> -autocomplete
<UP> - previous commend
<DOWN> - next command
Activity: Drills!
Entering commands flash cards x 3 (use set 1)
We’ll do this together, then try downloading it yourself: