Thank you, Carsten Dominik, for your work and inspiration. See Carsten’s original script.
dirabbrev is a compact Perl script to abbreviate and manage long directory paths.
The user is free to assign any alias to a desired path using a shell command or a configuration file, by default located at ~/.dirabbrev. dirabbrev then automatically saves the alias and the corresponding environment variable.
Abbreviations are reinstalled in every new instance of a shell.
Perl 5.003 or higher
- sh
- bash
- zsh
- fish
- csh
- tcsh
- ksh
You may want to save the file to your directory $USR_SCRIPTS with useful scripts, like ~/.bin or ~/.scripts, for example.
wget https://raw.githubusercontent.com/sdll/dirabbrev/master/dirabbrevcurl -O https://raw.githubusercontent.com/sdll/dirabbrev/master/dirabbrevThe syntax for .dirabbrev is simple. For a directory at /path/to/dir and the corresponding alias shortened_name, add the following line:
shortened_name /path/to/direval $(dirabbrev -a -e -d)eval (dirabbrev -a -e -d)