Nono.MA

Add a Folder Shortcut to the macOS Terminal

DECEMBER 15, 2017

To add a shortcut to your macOS Terminal, the only thing we need to do is to EXPORT that path in your bash profile. So go ahead and open the ~/.bash_profile file with a text editor, and add the following to the bottom of this file.

export MYFOLDER="/Users/username/Dropbox/folder"

This will add an environment variable $MYFOLDER to every new bash Terminal window you create. So you can navigate (or use the variable of this path) to this folder with:

cd $MYFOLDER

You can also type $MYFOLDER/other-folder —then press the TAB key— to expand the path shortcut to:

/Users/username/Dropbox/folder/other-folder

TerminalOs XMacos