4 ms·
I use this function in my bash profile to navigate to my projects from anywhere on the file system. function to { cd ~/Sites/$1/ } eg. cd ~/Sites/coen
by coenhyde 16y ago
I use this function in my bash profile to navigate to my projects from anywhere on the file system.
function to {
cd ~/Sites/$1/
}
eg. cd ~/Sites/coenhyde.com
$ to coenhyde.com
- deleted 16y ago[deleted]
- orlandu63 16y agoI would suggest mapping an alias instead of creating a function so that you will still be able to take advantage of parameter completion: > alias to='cd ~/Sites/'
- coenhyde 16y agoAh, much nicer. Thankyou. Edit: On testing it doesn't work. 'to sitename' just goes straight to ~/Sites/. I knew there must have been a reason i used a function instead of an alias.
- orlandu63 16y agoOh, that's right. 'to sitename' becomes 'cd ~/Sites/ sitename' which is not what you want. My apologies.