$ echo $CDPATH
/home/chaonaut/chaos:/home/chaos
$ pwd
/home/chaonaut
$ cd Ozric\ Tentacles
/home/chaos/Ozric Tentacles
$ pwd
/home/chaos/Ozric Tentacles
See also the aforementioned 'shopt -s autocd' and 'shopt -s cdable_vars'.
]]>eg.
alias gh='cd $HOME'
alias ge='cd /etc/'
alias gu='cd /usr/'
etc.
]]>alias Home='cd "$HOME"'
alias Pictures='cd "$HOME/Pictures"'
# etc..
also, if you want to 'cd "$HOME"' then you can just 'cd' and it assumes you want to go to ~
]]>Checking this out right now, kind of buggy imho - for example bash autocompletion doesn't always kick in without cd - it seems to work ok if a folder name is capitalized. Oh, well..
Prepend
./
before the foldernames, and the completion should work fine.
]]>shopt -s cdable_vars
export apps="/home/karol/apps"
export usb="/media/usb"
export cachedir="/var/cache/pacman/pkg"
export foo="/home/karol/test/foo"
export bar="/home/karol/test/bar"
in my .bashrc.
$ pwd
/home/karol/test
$ cd cachedir
/var/cache/pacman/pkg
$ pwd
/var/cache/pacman/pkg
$ cd foo
/home/karol/test/foo
$ pwd
/home/karol/test/foo
And then I create a file or folder with the same name as an executable and the joke is on you.
i should try this...
]]>And then I create a file or folder with the same name as an executable and the joke is on you.
You still need dot slash to launch a local executable, so i don't think those two would collide - besides, i can't remember naming folders "sudo" or "rm". But it's a valid point.
Not sure about bash, but zsh has an option for this. It's called autocd.
Thanks, it seems to be built in after all.
shopt -s autocd
Checking this out right now, kind of buggy imho - for example bash autocompletion doesn't always kick in without cd - it seems to work ok if a folder name is capitalized. Oh, well..
]]>And then I create a file or folder with the same name as an executable and the joke is on you.
Make a folder called cd.
]]>Thanks.
]]>