The Terminal
Lets examine an example of a UNIX command:
$: "prompt", printed by computer. May include useful info such as time, username, current directory
ls: The program, in this case ls="list files"
-al: Options/Flags, in this case a="include dot-files" and l="long format". Options are optional
~: Argument(s), in this case ~="User's home directory". Some commands - like ls - do not require arguments.
Note: on windows use "dir" instead of ls
The terminal is also called Command Line Interface (CLI)
The Terminal
Common commands:
cd <directory>: change directory
pwd: print working(current) directory
mv <file> <new location/name>: move (rename) file or directory
cp <file> <new file>: copy file
rm, rmdir <file>: remove file, remove directory
mkdir <directory>: create directory
touch <file>: create empty file or change update time of existing file
cat, less, tail <file>: print out content of file. cat: entire file, less: beginning*, tail: end (use with -f to monitor)
man <program>: manual of a program*. Note: this is your help. Try for ex "man cp"
which <program>: location of program. To verify exactly which ruby (for example) you are using
open -e <file>: Mac/OS X special to open file in an editor
*Navigation: space/b to move page down/up and q to exit