Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Sep 20 '12 at 23:16

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

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
@eveo: It did. Try readlink -f .. – choroba Sep 20 '12 at 18:56

You must log in to answer this question.