Key | Function |
---|---|
cmd + ` (grave accent) | switch between windows of a same program |
Shortcut List
- Mac keyboard shortcuts - support.apple.com
- Mac OS X Finder Keyboard Shortcuts - dummies.com
Display disk usage statistics sorted by human readable numbers (ref)
# use GNU sort which supports the missing option "-h"
$ du -hd 1 | gsort -h
Open man page in new terminal window (ref)
$ open x-man-page://<name>
zip
andunzip
# dry run, list files unzip -l file.zip # unzip specific file unzip file.zip path/to/file.txt # this will create "./path/to/file.txt" # unzip specific file and drop directory structures in archive unzip -j file.zip path/to/file.txt # this will create "./file.txt"
-
Display local location of homebrew itself or one of cloned tap https://docs.brew.sh/Manpage#--repository---repo-tap-
brew --repository [OWNER/REPO]
# /usr/local/Homebrew cd $(brew --repository) # tap OWNER/REPO is located in $(brew --reposot)/Library/Taps/OWNER/homebrew-REPO brew --repo homebrew/casks brew --repo dart-lang/dart
-
Show (installed) dependents of a formula https://docs.brew.sh/Manpage#uses-options-formula-
brew uses --recursive --installed <formula>
seen in https://stackoverflow.com/a/66142860 -
Show dependencies of a formula https://docs.brew.sh/Manpage#deps-options-formulacask-
brew deps <formula>
-
Adding formula or cask to Homebrew https://docs.brew.sh/Adding-Software-to-Homebrew
-
Formula Cookbook https://docs.brew.sh/Formula-Cookbook
-
Cask Cookbook https://docs.brew.sh/Cask-Cookbook
-
- Example: Homebrew/homebrew-cask-fonts#2082
- Show dependencies as a tree:
brew deps --tree <formula>
Name | Homebrew formula |
---|---|
ggrep |
brew info grep |
gsed |
brew info gnu-sed |
gsort |
brew info coreutils |
/etc/profiles
/usr/libexec/path_helper -s
/etc/paths
+ file lines under/etc/paths.d
- shell profiles (e.g., zsh startup files) see ref
Remove duplicates in zsh history (ref)
cat -n $HISTFILE | sort -t ';' -uk2 | sort -nk1 | cut -f2- > .zsh_short_history