MacOS
MacBook Quick Guide for Network Engineers & DevOps
This guide provides essential macOS shortcuts, terminal commands, and operations specifically useful for **Network Engineers & DevOps professionals**.
Essential Keyboard Shortcuts
Action | Shortcut |
---|---|
**Copy** | ⌘ + C
|
**Paste** | ⌘ + V
|
**Cut** | ⌘ + X
|
**Undo** | ⌘ + Z
|
**Redo** | ⌘ + Shift + Z
|
**Select All** | ⌘ + A
|
**Open Terminal** | ⌘ + Space → type Terminal
|
**New Terminal Window** | ⌘ + N (in Terminal)
|
**New Terminal Tab** | ⌘ + T (in Terminal)
|
**Close Tab** | ⌘ + W
|
**Force Quit an App** | ⌘ + Option + Esc
|
**Switch Between Open Apps** | ⌘ + Tab
|
**Show All Open Windows (Mission Control)** | Control + ↑
|
**Switch Between Desktops (Spaces)** | Control + → / Control + ←
|
Useful Terminal Commands for Network Engineers
System Information
uname -a # Show system information system_profiler SPHardwareDataType # Detailed Mac hardware info sw_vers # Show macOS version uptime # Show system uptime
Network Diagnostics
ifconfig # Display network interfaces & IPs netstat -rn # Show routing table dig example.com # Query DNS records nslookup example.com # Perform DNS lookup ping 8.8.8.8 # Test network connectivity traceroute google.com # Trace network path
SSH & Remote Access
ssh user@host # SSH into a remote server scp file.txt user@host:/path/ # Secure copy file to remote host rsync -avz /source/ user@host:/dest/ # Sync files efficiently ssh -L 5901:localhost:5901 user@host # Create SSH tunnel
Network Monitoring & Packet Capture
tcpdump -i en0 port 22 # Capture SSH traffic on WiFi interface sudo lsof -i :80 # List processes using port 80 sudo netstat -anp tcp # Show active TCP connections sudo dscacheutil -flushcache # Flush DNS cache arp -a # Show MAC-to-IP mappings
Get Serial Number
system_profiler SPHardwareDataType | grep Serial
Get Hostname
scutil --get HostName
Set Hostname
sudo scutil --set HostName <new host name>
DevOps & Automation Commands
Git & Version Control
git status # Check repo status git pull # Fetch latest changes git commit -m "message" # Commit changes git push origin main # Push to remote repo
Docker & Kubernetes
docker ps # List running containers docker logs container_id # View container logs kubectl get pods -A # Show all Kubernetes pods kubectl describe pod pod_name # Detailed pod info
Terraform
terraform init # Initialize Terraform terraform plan # Preview changes terraform apply # Deploy infrastructure terraform destroy # Tear down infrastructure
File System Commands
ls -lah # List files with details cd /path/to/dir # Change directory mv oldname newname # Rename/move files cp file1 file2 # Copy files rm -rf directory # Force delete directory find / -name "file.txt" # Search for a file
Productivity Tricks
- **Three-finger swipe left/right** → Switch between desktops
- **Three-finger swipe up** → Open Mission Control
- **Pinch with thumb & three fingers** → Open Launchpad
- **Use Spotlight (`⌘ + Space`)** → Quickly find files, apps, or even do calculations
Pro Tip
- Create an alias for frequent commands:**
Edit `~/.zshrc` and add:
alias ll='ls -lah' alias k='kubectl' alias tf='terraform'
Then run:
source ~/.zshrc
This saves time by shortening commands.