Mac OS Terminal Tricks

September 5, 2017    terminal    commandline   

A place to put some of the tricks I use on the terminal on my MacBook Air.

Search over old commands

Use control-R (not cmd-R) to get a “search” for old commands. So if I do ctrl-R then type in ssh, I’ll see the most recent command with an ssh in it (starting it?)

Hot Codes

These are called aliases. When I type in dropbox or research on my terminal, terminal knows to cd to those folders (even though on my Air the folders are held on stupidly complex paths involving my external HD).

Mac

Easy to do, follow this: https://stackoverflow.com/questions/8967843/how-do-i-create-a-bash-alias

These are for my BU login on my macbookair, but changing the volumes will make it work with other set ups:


alias dropbox="cd /Volumes/Seagate/Dropbox/"
alias research="cd /Volumes/Seagate/Dropbox/Research"
alias website="cd /Volumes/Seagate/Dropbox/Academia/Website/hugo-sustain"
alias kb="cd /Volumes/Seagate/Dropbox/Research/_KnowledgeBase"

PC

On my PC in ConEmu, change the environment in settings. Currently I have 3:

  • research to go to research
  • kb to go to the _Knowledgebase folder
  • website goes to my website folder