Source bmark.sh
in your ~/.bashrc
.
(Enableing cdable_vars
in Bash makes this script better.)
Bookmark current directories:
$ bmark name
Recommended name format: [-A-Za-z0-9_]+
.
Avoid special characters.
Use basename as the default bookmark name:
$ bmark
List all bookmarks:
$ bmarks
Go to one bookmark:
$ cd $name
If you've shopt -s cdable_vars
in ~/.bashrc
, you can omit
the $
symbol:
$ cd name
$ pushd name
Pushd
and popd
also work,
since bookmarks are simple variables.
Organize the bookmark:
$ editor ~/.config/bmark/rc
AFAIK, my implementation (this script) is the only one which
- integrates with bash builtin
cd
,pushd
,popd
, etc, instead of a seperate goto command - avoids duplicated bookmarks
- uses basename as the default bookmark name