An alternative is to use symbolic links. Advantages:
- It will work in all applications, rather than just your shell.
- If you change or add shortcuts, it will immediately update everywhere, rather than having to restart applications before they see the new environment variable.
To do this, I have a directory to contain my shortcuts:
$ mkdir ~/_
$ ln -s /path/to/dir ~/_/dir
Then I can refer to the directory as ~/_/dir
. You can also create more shortcuts, e.g. ln -s /media/username/backup_disk/backups ~/_/bak
.
If you're the only human user on your computer, save a keystroke by creating the shortcut directory higher:
$ sudo mkdir /_
$ sudo chown username: /_
$ ln -s /path/to/dir /_/dir