Access any previously visited directory typing cd part_of_path
After using the cd
command several times, you will have a set of directories that you can easily access like bookmarks. For example:
You accessed the /home/user/Downloads/
once. Next time you want to visit the /Downloads
directory you can just type cd Downloads
anywhere, or even cd Dow
, for instance.
When you access any directory using the cd
command, the full path is stored into the ~/.autoleap.history
file.
When you type any string after the cd
command, the script will try to change to the directory you've specified. If the directory does not exist, the script will search the history file for that string and change to the path if it is found in the history file.
All of this is possible because the script declares a cd
function that enhances the built-in cd
command by adding new functionalities.
- Be sure you use the bash shell, since this script was written for it.
- Download the script
autoleap.sh
anywhere. source
the script on your.bashrc
(add the linesource /path/to/script/autoleap.sh
to the end of your.bashrc
)- Reopen the terminal (or source
.bashrc
)
This project was inspired by wting/autojump.