If I type in cd Desktop
, no matter what folder the terminal is currently open in, I want it to navigate to /home/bob-ubuntu/Desktop
In my .bashrc
file I have the following lines at the bottom:
alias desktop='/home/bob-ubuntu/Desktop'
alias Desktop='/home/bob-ubuntu/Desktop'
and then I source it, but when I type in cd Desktop
or cd desktop
it still gives the same error?
desktop(){ cd $HOME/Desktop ; }
or you can set the CDPATH variable to "$HOME:." and use "cd Desktop"CDPATH
) this would makecd
always go to a directory in your home directory over a directory in the current directory.