dirnav
augments cd by adding the prevd
, nextd
and cdh
commands.
Bash and other POSIX shells lack this convenience feature provided by fish
, so I added it in.
Move through your cd
history with prevd
and nextd
, and visualize your cd
history with cdh
.
The history for each terminal session / PID is stored in /tmp/dirnav{PID}.log. It is up to you to clean this up periodically, if you want to. There is no limit to the size of the history. If you jump to another directory when you're in the middle of the history chain, all following directories are cleared.
cd ~/Documents/
cd ~/Downloads/
prevd # You end up at ~/Documents
nextd # You again end up at ~/Downloads
cdh # Show history
git clone https://github.com/Krishna-Sivakumar/dirnav.git
cd dirnav
go build
cp dirnav /usr/bin/
cat aliases.sh >> ~./bashrc # (or whatever other shell configuration file you use)