Skip to content

Instantly share code, notes, and snippets.

@SHDShim
Last active January 13, 2024 22:50
Show Gist options
  • Save SHDShim/b575a242f7258e1a829fa7a9cfe66810 to your computer and use it in GitHub Desktop.
Save SHDShim/b575a242f7258e1a829fa7a9cfe66810 to your computer and use it in GitHub Desktop.
Add favorite folders in bash_profile

To make a shortcut to favorite folders in Mac OS

Place the following lines in .bash_profile.

X, Y, Z = change to your folder names.

# define favorite paths
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi
shopt -s cdable_vars
export dropbox=~/Dropbox\ \(X\)
export current=~/Dropbox\ \(X\)/Y
export overleaf=~/Dropbox\ \(X\)/Y/Z

Then enjoying going directly to your favorite folders by:

cd dropbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment