"directory-marks" is a bash shell script that allows you to save and jump to periodically used directories. This tool is based on a prior implementation of "shellmark and "bashmarks". The fork was necessary because I did not receive any feedback on pull requests. If one of the authors would like to review and accept my adjustments, I would be happy to send them to them via pull request.
- Clone repository
git clone [email protected]:scoopex/directory-marks.git
- Installation
cd directory-marks` export INSTALL_DIR="$HOME/bin" make install
- Add the shell completion to your
.bashrc
configuration. (this is essential to to "directory-marks")make config exec bash
- Use it:
cdm --help cdm -s os-configs /etc cdm -s os-logs /var/log cdm os-<TAB><TAB>
$ cdm --help
Usage: cdm [OPTIONS] [directory-mark...] [directory]
-d, --delete Deletes directory-marks from list
-g, --go Goes (cd) to the directory pointed to by directory-mark
-p, --print Prints the directories pointed to by directory-marks
-s, --set Saves DIRECTORY or else $PWD as directory-mark
-r, --replace Replaces DIRECTORY or else $PWD as directory-mark
-h, --help Lists all available directory-marks
-l, --list Lists all available directory-marks
-L, --listdir Lists all available directory-marks and the directories they point to
$ cd /var/www/
$ cdm -s webfolder
$ pwd
/var/www/
$ cd /usr/local/lib/
$ cdm -s locallib
$ cdm -l
locallib
webfolder
$ cdm -p webfolder
/var/www/
$ cdm --go <TAB><TAB>
webfolder locallib
$ cdm --go l<TAB>
$ cdm --go locallib
$ cdm web
$ pwd
/var/www/
$ cdm simpsons
bash: cd: Error: Shellmark does not exist!: No such file or directory
$ cdm -d webfolder web
All of your directory bookmarks are saved in ~/.config/shell/directory-marks
but that can easily be changed just by changing the DMFILE environment variable.