Super cd
July 20th, 2008[ Linux ]
I pitched the idea a while back to a friend for a super cd. The idea being to add a means of easily creating, managing, and using shortcuts to directories you often use. I currently handle this by creating aliases in my .bashrc like this one:
alias cddir=”cd /home/some/directory/used/a/lot”
It’s a pain, however, to manage them, recall what I named one, delete old ones etc. So my thought was to build a python program to wrap cd. You could then use some special syntax like hashing to reference shortcuts. So typing “cd #dir” would move you into the directory you saved under shortcut “dir”. If super cd didn’t feel the command was meant for it then it would simply pass the request down to the base cd.
While sitting here in Vancouver sipping a tasty americano, I finally got around to some searching to figure out how I could change directories in a shell by calling into a python script. Not quite as simple as it first seems. In searching for that I not only found the answer but I found almost the exact tool I was about to write. Adding to the weirdness is the fact it appears to be written by a guy here in Vancouver.
If you use a shell, try go. While not exactly what I had planned, it allows you to type “go -a dir” to add the current directory. Then type “go dir” at any point later to change back to that directory. I like…