These are the macOS notes I keep coming back to: a few terminal motions, a handful of editor shortcuts, and the steps for turning a fresh machine into a working one. They are written for someone who is comfortable opening Terminal but does not want to memorise the whole system.
Move around the terminal
CtrlandEputs the cursor at the line's end.CtrlandAputs the cursor at the line's start.CtrlandWdeletes the word before the cursor.CtrlandUdeletes to the start of the line.Optionand the left or right arrow moves by word.
These motions work in most shells that use readline style editing. They save a surprising amount of reaching for the mouse.
Copy command output
On macOS, pbcopy sends text to the clipboard. On Linux, the equivalent is usually xclip. Piping a command into it is often faster than selecting text in the terminal window.
ls | pbcopy
pwd | pbcopy
Editor shortcuts worth learning
In Xcode, Ctrl and Command and E selects every occurrence in scope. Selecting a variable and then pressing Command and E sets it for a find, and Command and G moves to the next occurrence. Shift, Command, and G moves to the previous one.
To clear the workspace, Ctrl and Command and F enters full screen. Option and Command and T hides the toolbar. Command and 0 hides the navigator, Option and Command and 0 hides the inspector, and Shift and Command and Y hides the debug area. Option and Command and the left arrow folds the current block.
A clean setup, in order
- Restart and hold
CommandandRto enter recovery mode. - Open Disk Utility and erase the startup disk if you want a clean system.
- Reinstall macOS and follow the prompts.
- Install Xcode from the App Store.
- Install Homebrew and use it for the rest of the command line tools.
- Install zsh and a shell framework if you want one.
- Install Git, Python, Node.js, and the editor you use most.
brew install zsh
brew install tree
brew install git
pip install virtualenv
Open Terminal preferences and choose a profile you like. A readable font and a sensible cursor colour make long sessions less tiring.
Copy a path from Finder
Right click a file or folder, then hold Option. The usual copy item changes to a command that copies the full path. Select it and paste the path wherever you need it.
Keep the machine awake and locked
In Energy Saver, choose the setting that keeps the machine awake even after the screen goes dark. In Security and Privacy, require a password as soon as the screen locks. Now you can darken the screen with a shortcut while the computer stays awake.
Verify a checksum
Use shasum to compute a digest, then compare it with the value published by the source. If the two strings differ, do not run the file. A checksum is a simple integrity check, not a guarantee of safety, but it catches a surprising number of bad downloads.
A clean machine is a chance to write down what you actually need. Most of the rest can wait.