bcd - Bookmark Change Directory
bcd
is a way to cd
to directories that have been bookmarked.
Installation
1: Install bookmark-cd
Currently the way to install bcd
is via the rust tool cargo:
cargo install bookmark-cd
2: Setup your environment
At the moment, only the bash
shell is supported, feel free to contribute if you are reading this and youmuse a different shell.
Run the following command to set up your bash environment.
bookmark-cd -i
What this task is doing is:
- Touching a file to hold your bookmarks in your home folder
.bcd
- Adding the following command to your
~/.bashrc
file to add thebcd
shell function when you start your shell:eval "$(bookmark-cd init)"
Restart your shell
As the shell function creation only gets run when you start a new instance of your shell, you need to start a new shell before the bcd
command works.
Create some bookmarks
# create a bookmark to the logs directory
cd /var/log
bcd logs
# move to home
cd ~
# list the bookmarks
bcd -l
# change to the bookmarked directory
bcd logs
pwd
Contribute
There are many shell that this tool could be used on, I just don't use them. I would be happy to take a look at any PRs that add support for other shells.