Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 ubuntu 上工作,刚刚安装了 lamp。作为 linux 新手,我不确定如何在 lamp 服务器的 /var/www 下创建目录或文件以开始处理我的网站项目
在 *nix 下mkdir newdirname,您可以使用创建目录,也可以使用创建新的空文件touch newfilename。这些是您需要从 shell/终端执行的命令。为了到达/var/www,您将需要cd /var/www。
mkdir newdirname
touch newfilename
/var/www
cd /var/www
如果您是 Linux 新手,我建议您阅读任何类似this或this的基本指南。
作为普通用户,您可能没有足够的权限来添加文件或创建目录。您可以更改 /var/www 目录(以及其中的所有内容)的所有权,也可以更改sudo要添加的每个目录。
sudo
从提示: chown [your_user_name].users -R /var/www
然后你可以创建mkdir [directory name]一个目录或touch [filename]创建一个文件。
mkdir [directory name]
touch [filename]
如果你不改变/var/www的权限你可能需要sudo在上面的每一个命令前面加上(会提示输入密码)