Terminal (Mac)
brew package manager
- Shells
- bash script
- Tips - Handling Files & Directories
- Tips - Keyboard Shortcuts
- Kill a process
- Using alias
- Using curl
- Using find
- Using grep
- Cheatsheet
- Linux Commands by Alex Xu
Plugins
Auto Completion
# Bash version
$ bash --version
# Auto Completion
## If running Bash 3.2 included with macOS
$ brew install bash-completion
## or, if running Bash 4.1+
$ brew install bash-completion@2
Working with JSON
Bash doesn't ship with supporting JSON out of the box. If you do not have a command line utility (jq), install it
$ brew install jq
Examples
# Read and use JSON in bash
$ echo '{"a": {"b":123 } }' | jq '.a.b' # returns 123 as output
# Read API response
$ curl https://swapi.co/api/people/2 | jq # Pretty print JSON
# Pass a JSON file to jq for filtering content
$ jq '.dependencies | keys' package.json