i m working on ubuntu and just installed lamp.As i m new to linux i m not sure how to create a directory or file under /var/www of lamp server to start working on my website project
2 Answers
Under *nix you can create a directory using mkdir newdirname
and you can create a new and empty file, using touch newfilename
. Those are commands you need to execute from a shell/terminal. In order to get to /var/www
, you will need to cd /var/www
.
If you are new to Linux I suggest reading any guide on basic like this or this.

- 4,479
- 4
- 31
- 50
-
thank you so much the way u explained was awesome...n i ll read these tutorials now...:-) – frank Mar 02 '11 at 08:49
Chances are you do not have sufficient privileges as your normal user to add files or create directories. You can either change the ownership of the /var/www directory (and everything within) or you can sudo
each one you want to add.
From the prompt: chown [your_user_name].users -R /var/www
Then you can mkdir [directory name]
to make a directory or touch [filename]
to create a file.
If you do not change the permissions of the /var/www you may need to put sudo
in front of each of the above commands (will be prompted for password)

- 7,865
- 3
- 29
- 32
-
ya i have the access to the root ....but thnks for the syntax of creating a directory that wat i was looking for....thnkwieeeeeee – frank Mar 02 '11 at 08:50