PDA

View Full Version : [ubuntu] shortcut cd



mferarri
March 18th, 2012, 05:41 AM
hi ubuntuforums,

if i have a folder structure like this: home/user/pics/animals/downloaded/google_images/mammals/ ,
is there a way to quicky cd into the mammals folder without typing the long directory?

zombifier25
March 18th, 2012, 05:53 AM
Well, place this at the end of your .bash_rc

export IMG=/home/user/pics/animals/downloaded/google_images/mammals/After you're done, type this in your terminal to apply the changes:

source .bashrcDone! Now, whenever you want to enter that directory, you only need to enter this:

cd $IMG

Of course, you can always replace IMG and the directory with whatever you like.

mferarri
March 18th, 2012, 06:08 AM
Well, place this at the end of your .bash_rc

export IMG=/home/user/pics/animals/downloaded/google_images/mammals/After you're done, type this in your terminal to apply the changes:

source .bashrcDone! Now, whenever you want to enter that directory, you only need to enter this:

cd $IMG

Of course, you can always replace IMG and the directory with whatever you like.

thanks dude, but kinda was wishing i could type the folder name and it would search for it and go to it.oh well.

oldos2er
March 18th, 2012, 05:23 PM
Create an alias in ~/.bashrc, something like
alias mam='cd home/user/pics/animals/downloaded/google_images/mammals/' Restart the shell, type mam.