I’m always looking for “things” to make my bash more productive. A few days ago i found another good hint.
If you have to switch between multiple directories, it would be nice to create some bookmarks for them on the fly.
So i created some bookmarks:
#bookmarks alias cb1='alias b1="cd `pwd`" && echo -e "\nBookmark b1: `pwd` created.\n"' alias cb2='alias b2="cd `pwd`" && echo -e "\nBookmark b2: `pwd` created.\n"' alias cb3='alias b3="cd `pwd`" && echo -e "\nBookmark b3: `pwd` created.\n"' alias cb4='alias b4="cd `pwd`" && echo -e "\nBookmark b4: `pwd` created.\n"' alias cb5='alias b5="cd `pwd`" && echo -e "\nBookmark b5: `pwd` created.\n"' alias cb6='alias b6="cd `pwd`" && echo -e "\nBookmark b6: `pwd` created.\n"' alias cb7='alias b7="cd `pwd`" && echo -e "\nBookmark b7: `pwd` created.\n"' alias cb8='alias b8="cd `pwd`" && echo -e "\nBookmark b8: `pwd` created.\n"' alias cb9='alias b9="cd `pwd`" && echo -e "\nBookmark b9: `pwd` created.\n"' alias lb='alias | grep -e "alias b[0-9]"|grep -v "alias cb"|sed "s/alias //"'
With this aliases you can create and access the bookmarks.
Create a bookmark:
[user@itzamna:/usr/src/linux]$ cb1 Bookmark b1: /usr/src/linux created. [shellmann@itzamna:/usr/src/linux]$
You can display your bookmarks with lb:
b1='cd /usr/src/linux' b2='cd /etc/acpi/events'

