Collection of bash commands

Unstructured list of terminal commands I sometimes forget. So I made this list to look some of them up.

Max Stralka
Sep 7, 2018 · 2 min read
  • curl ipecho.net/plain; echo → Own current public IP address
  • mdfind -onlyin ~/Documents Skateboard → uses spotlight to search for a word in certain folder
  • ditto Folder_A Folder_B → Merge Folder_A into Folder_B (Including all Subfolders)
  • traceroute facebook.com → prints the route data packets take to network host
  • ‘ls -la’ → lists also the hidden files and shows access rights
  • killall >Application name< → Quits the named Application
  • sudo reboot → Reboot Computer
  • sudo halt → Shut Down Computer
  • say Hi! → Computer speaks the Words after Say
  • scp -i keyfile.pem /Users/username/Documents/folder/etc/local.xml ec2-user@123.45.678.90:/var/www/html/app/etc → Upload a file to a server using a .pem key
  • scp -r -i keyfile.pem ec2-user@123.45.67.890:/var/www/html /Users/username/Documents/directory/ → Download folder from server usingg a .pem key
  • defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool FALSE → Prevent applications from saving to iCloud by default (undo command here: Link)
  • top → View All Active Processes
  • screencapture -M image.png → takes screenshot and puts it into a new email
  • ifconfig → Shows all network parameters (i.e. own IP
  • sudo tcpdump → Shows current tcp traffic (in and out) from your computer
  • netstat -rn → show network status
  • dig → DNS lookup utility
  • pwd | pbcopy → Copy current working directory to clipboard
  • find . -size 1033c → looks in the current directory (and all directories in it) for a file with the size of 1033 Bytes
  • find . -size 33c 2>/dev/null → Hide ‘Permission denied’ files and only show files where you have access to
  • ln -s → creates Symlink (i.e. ln -s “/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl” ~/bin/subl)
  • locate filename → Find files and folders (only uses System Files and discards personal user files)
  • mdfind filename → uses the Spotlight index to find files
  • airport -I → Display Information on current wifi-status
  • diskutil list → Lists current portions on drive
  • crontab -l → displays all cronjobs
  • crontab -r → clears cronjob list
Max Stralka

Written by

Berlin based Web & iOS Developer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade