Ubuntu - Create a link to a specified directory so I can easily change to that directory

Posted by Denby on Super User See other posts from Super User or by Denby
Published on 2010-03-16T02:47:57Z Indexed on 2010/03/16 5:06 UTC
Read the original article Hit count: 373

Filed under:
|
|
|
|

Is it possible to create a symlink to a directory, like /var/lib/tomcat6/webapps/MyWar that I can access from everywhere? I want to be able to say cd myapp from anywhere in the directory tree and go to that directory. Is it only possible in the directory where I create the symlink?

Do I have to update my ~/.bashrc file to include an alias like: alias myapp="cd /var/lib/tomcat6/webapps/MyWar" and then just type myapp from anywhere? What is the best way to handle this situation so I don't always have to type in the long directory? I also want to be able to use that parameter in say a copy command, so the alias wouldn't help in that situation. Hopefully I can do something similar where ~ maps to the home directory in any command.

© Super User or respective owner

Related posts about ubuntu

Related posts about linux