Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 95620  / 2 Years ago, tue, february 8, 2022, 12:06:14

Possible Duplicate:

Whats the simplest way to edit and add files to “/var/www”?






I've just finished installing LAMP on Ubuntu and I've gone to start created a website directory and I don't know how to get into the "root" directory of LAMP.



Can I use the terminal? if so what would be the commands to create a new folder and create sub-folders inside that directory. Also save PHP, CSS files into the directory and also images.


More From » lamp

 Answers
4

In a terminal use the next commands:



cd = Change Directory



cd /var/www


mkdir = Make Directory, this command requires elevated privileges, so run it with sudo or gksudo



sudo mkdir foldername


(where foldername is the name of the folder that you wish to create).



You can create subfolders from within /var/www without changing to the desired destination by using:



sudo mkdir foldername/subfolder


cp = Copy one or more files to another destination



cp PATHTOSOURCE/file.php PATHTODESTINATION


This can be used for any kind of file.



Note: If you wish to use a GUI for these tasks, you can use Nautilus with elevated privileges, simply hit Alt+F2 and write gksudo nautilus, then Enter after which you will see Nautilus File Browser, press Control+L and write /var/www and you can copy/paste or drag/drop anything you wish with ease.



For a comprehensive list of the commands, visit: http://ss64.com/bash/



Good luck!


[#35888] Wednesday, February 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tusmuumu

Total Points: 195
Total Questions: 122
Total Answers: 104

Location: Oman
Member since Tue, Feb 7, 2023
1 Year ago
;