Sunday, September 11, 2011

In magento I have been jumping over all the directories to be able to see the code. Half my life was being spent on CDing.

Then I found this easy script

Basically it allows you to do a save on any alias and then go to the alias.

The script is basically very simple and can be easily used in any bash shell by adding it to .bashrc or .bash_aliases (for sake of completion)

# Bash Directory Bookmarks
alias m1='alias g1="cd `pwd`"'
alias m2='alias g2="cd `pwd`"'
alias m3='alias g3="cd `pwd`"'
alias m4='alias g4="cd `pwd`"'
alias m5='alias g5="cd `pwd`"'
alias m6='alias g6="cd `pwd`"'
alias m7='alias g7="cd `pwd`"'
alias m8='alias g8="cd `pwd`"'
alias m9='alias g9="cd `pwd`"'
alias mdump='alias|grep -e "alias g[0-9]"|grep -v "alias m" > ~/.bookmarks'
alias lma='alias | grep -e "alias g[0-9]"|grep -v "alias m"|sed "s/alias //"'

However there is now a better script which helps you save the names in more readable format and then go to that. For that you should look up the script yourself.

No comments:

Post a Comment