Skip to main content

Command line

General tricks​

Go to last directory​

This will change to the last directory you were in.

cd -

History​

Use Ctrl-r to search through your command history.

Clipboard​

Copying to the clipboard​

This will copy the contents of file.txt to your clipboard.

cat file.txt | pbcopy

Pasting from the clipboard​

This will paste the contents of your clipboard into the file file.txt.

pbpaste > file.txt