cd with weighted marks
This is a script similar in functionality to Bash's
builtin commands. Every time you change directory it updates a bookmarks file
either by adding a new entry or by increasing the weight of an existing one. The
marks with highest scores are at the top of the file so they get matched first.
The format is: weight directory (optional bookmark)
Once you've been to the above location you can return by simply typing:
c li (or any string part of the directory)
Note: You could also
<tab> complete your filter in order to list all
c li<tab> will generate a list of bookmarked and default
directories merged together. Use
cx li<tab> if you want a bookmarked list only.
Filtering further is also possible:
c sr li will ensure you don't end up in
/usr/share/lib if it has a higher score!
As an additional bonus you have the possibility to create a named bookmark by
cb bookmark while in the desired location. A named bookmark must NOT
c /usr/src/linux cb kernel
Now the entry is:
4 /usr/src/linux kernel, thus you could come back with
c ker or
c rne or ...
$ touch ~/.cdmarks
sourcethe script in your
$ exec bash
You are ready!
cs filter ... will list your bookmarks (similar to
ci can help you with migrating a personal
Note 2: Never use ~ in
~/.cdmarks.skel or if manually entering bookmarks in
~/.cdmarks (use the value of
HOME instead). Don't terminate paths with a
Note 3: If you want to use a different name than
alias new_name=cd_bookmarks after the
Note 4: Get help with