List

ls

Flags
-l ---> show in long format
-a ---> all directories (including dots)
-h ---> show unit suffixes
-t ---> sort by time modified
-tr --> reverse time sort order
-S ---> sort by size
-Sr --> reverse size sort order
-ld --> list directories as plain files

Example
ls -lat
ls -latr

Good for limiting the scope of a wildcard search to the current directory
ls -lahd *dev*

Tar

Zip and unzip different files and directories as a Text ARchive file using different compression methods.
tar

c --> create
x --> extract
v --> verbosely
f --> to file
z --> gzip compress
u --> update
C --> to a non-current directory

tar --> no compression
tar.gz --> gzip compression
tar.bz2 --> bzip2 compression

Create
Create tarchive from source directory
tar -cvf filename.tar source_directory/
tar -cvfz filename.tar.gz source_directory/
tar -cvfj filename.bz2 source_directory/

Trailing slash on source directory is essential for tarchiving Solr schemas on a Mac

tar -cvfz myhiwayschema.tar.gz myhiwayschema/

List
List all files in tarchive
tar -tvf filename.tar /source_file_directory

Extract
Extract file into current working directory as folder called "filename"
tar -xvf filename.tar
tar -xvfz filename.tar.gz
tar -xvfj filename.bz2

Extract file into some other already created directory
tar -xvf filename.tar -C /other/directory/

Don't overwrite or replace
tar -xvfk filename.tar

Extract specific file(s)
tar -xvf filename.tar filename_1 filename_2

SSH
Secure Shell access to a remote console
ssh username@hostname
ssh username@11.22.33.44

SCP
Securely copy a file between hosts. Direction is always from source to target.
scp source target

Host can be local or the remote
scp user@remote:/remote/a.png /local/a.png --> send from remote to local
scp /local/a.png user@remote:/remote/a.png --> send from local to remote

On a Mac, spell out the whole local path /Users/username/Desktop/a.png

Copy more than one file to directory
scp *.png user@remote:/directory/

Copy directory to directory
scp -r thisdirectoryhere user@remote:/home/user/

Specify a host port (capital -P)
scp -r -P 44444 /Users/username/Desktop/this.png user@remote.com:/home/user/images/
scp -r -P 44444 user@remote:/home/user/images/this.png /Users/username/Desktop/