Alternative for Quick Cli Filesystem Navagation Shortcutting
I saw this great blog post about an easy way to create and remove shortcuts for commandline navagation to often used directories.
In the past I would often manually make bash aliases for commonly used directories, so I was psyched to automate this. I much prefer just typing the DirName
instead of the jump DirName
used in Jeroen’s version, so I modified his commands with my own.
Here are the commands I came up with.
1 2 3 4 5 6 7 8 9 |
|
This may not be the most elegant way of doing things (that sed command is fairly heinous) but it works great.
BTW keeping my bash_aliases file inside of dropbox is amazing…aliases and functions instantly appear on all my machines. It’s rad.
P.S. originally I had the unmark
command looking like this
1 2 3 4 |
|
which seems like a only minor modification from the current version. This seemingly minor change of alias $1
–> alias $1='cd
looks like nothing, but one time I accidentally typed
1
|
|
which created the line alias ='cd ~/WhereverIWasWhenIDidThis'
in my ~/Dropbox/Config/bash_aliases
realising I just made a empty alias I immediatly tried removing the alias with
1
|
|
which proceded to delete all aliases in my ~/Dropbox/Config/bash_aliases
!!!
That was interesting, thank goodness for dropbox backing things up (another reason to keep config files in dropbox).
Let me know what you think in the comments or hit me up on twitter.