Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Installed Apache and the default working directory is /var/www, when I'm in /root I don't want to navigate to /var/www every time I want to get some work done.

Can I create a link in /root called web or something?

I just bought a VPS from Linode, installed Ubuntu 10.04 LTS and learning how to use it.

share|improve this question

migrated from stackoverflow.com Sep 20 '12 at 23:16

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 3 down vote accepted

A different solution is to create an alias in your shell.

If you are using bash, put the following in /root/.bashrc:

alias cdw="cd /var/www"

Next time you login you can type "cdw" and go to that directory. You can type this from anywhere and be brought to the /var/www directory.

share|improve this answer
    
Perfect thanks. –  eveo Sep 20 '12 at 19:01

Go to /root

cd /root

and type this:

ln -s /var/www web

Then you'll have a folder web in /root that points to /var/www

share|improve this answer
ln -s /var/www .

will give you a link called www to /var/www in the current directory.

share|improve this answer
    
I just did cd www and it didn't point me to /var/www. Any way to do this? –  eveo Sep 20 '12 at 18:55
1  
@eveo: It did. Try readlink -f .. –  choroba Sep 20 '12 at 18:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.