
macOS, /bin/bash, Homebrew
Keyboard Symbols
⌘ Command
⌥ Option (alt)
⎋ Escape (esc)
⇧ Shift
⌫ Backspace (delete)
⌃ Control
fn Function
⇪ Caps lock
␣ Space
⇥ Tab
return (enter)
←↑→↓ Arrow Keys
Shortcuts
⌘ Command + ␣ Space = Spotlight Search
fn Function + ⌫ Backspace = Forward Delete (suprimir)
⇧ Shift + ←↑→↓ = Select
⌥ Option + ⌘ Command + ⎋ Escape = Force Quit
⇧ Shift + ⌘ Command + 3 = Screenshot
⇧ Shift + ⌘ Command + 4 = Selective Screenshot
⇧ Shift + ⌘ Command + 5 = Screenshot with options
⌘ Command + ⇧ Shift + ⌫ Backspace = Empty Trash (Finder)
⌘ Command + ⇥ Tab = Switch Apps
⌘ Command + , = Preferences (current App)
⌘ Command + A = Select All
⌘ Command + C = Copy
⌘ Command + D = Duplicate
⌘ Command + F = Find (current app)
⌘ Command + Q = Quit (current app)
⌘ Command + P = Print
⌘ Command + V = Paste
⌘ Command + X = Cut
⌘ Command + Z = Undo
⇧ Shift + ⌘ Command + Z = Redo (after Undo)
⌃ Control + C = Stop running process
⌥ Option + ⇧ Shift + - = Long Hyphen (—)
fn Function + F2 = Edit Cell Excel
Troubleshoot
Safe mode: ⇧ Shift key
Boot devices: ⌥ Option
Recovery mode: (Reinstall OS or factory reset)
⌘ Command + R (Intel based processors)
Press and hold power button (Apple Sillicon)
Finder>Go to Folder or ⇧⌘Z:
~/Library/Caches
control > right-click (open)
⌥ Option + ⌘ Command + P + R
Power on and listen for 2 startup sounds
⇧ Shift + ⌃ Control + ⌥ Option + Power
Press at any time for about 1/2 second then release (The computer will shut down)
Terminal /bin/bash (specific for macOS)
% man <command> # manual of the <command>
% <command> -h # Command help
% clear # clear the terminal
% ls # list files
% ls -l # list files with permissions
% cd # change directory
% say <sentence> # say out lout <sentence>
% mkdir <dir> # Create directory
% touch <file.ext> # Create file
% rm <file> # Delete file
% rm -R <dir> # Delete folder and its content
% cp <file> <newfile> # Copy a file to the current folder
% cp <file> <dir> # Copy <file> to the <dir>
% <command> | pbcopy # copy output to clipboard
% caffeinate # keeps your mac awake till ⌃+C is pressed
% ditto # better version of copy
% <command> | grep <filter> # filter results
% top # running processes
% uptime # time since mac was turned on
% history # history of the commands typed on the prompt
% sudo shutdown -h now # poweroff mac now
% sudo shutdown -r now # restart mac now
% ps -ax # Processes
% ps -ax | grep <filter> # filter or find process
% kill -9 <PID> # kill a process through its ID
% sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' # watch download history
## Network Commands
% ping <host>
% ifconfig # Show ip configuration
% ifconfig en0 # Show interface configuration
% ifconfig en0 | grep inet # Select interface and filter by inet
% ipconfig getpacket en0
% ipconfig set en0 DHCP # Renew dhcp lease
% ssh <user>@<host>
% arp -a # Quick scan to LAN neighbours
% traceroute <domain/ip> # Identify the path and hops traversed by packages
% dscacheutil -flushcache # dschacheutil -flushcache
% dig <domain> # DNS info
% whois <domain> # registry domain info
% curl -O <url-to-file> # Download file via HTTP, HTTPS, or FTP
% netstat -nr | grep default # default gateway
% networksetup -listallhardwareports # network interfaces
Homebrew
% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
% brew update
% brew install cmatrix
% cmatrix
Apple Device Support Certification
Prerequisites