linux - cp : target '/root/var/www/html/' is not a directory

标签 linux shell ubuntu operating-system sh

我正在使用 Ubuntu windows 10 bash,我想将项目从/mnt/i/Projects/Template 移动到位于/var/www/html 的 Apache 服务器上运行。

我尝试将文件夹从直接复制到新文件夹,但不幸的是我收到了一个错误:

cp -r /mnt/i/Projects/Template ~/var/www/html/
cp: target '/root/var/www/html/' is not a directory

我想用 Apache 测试这些模板,并尝试直接更改 Apache。

我做的另一个测试:

root@DESKTOP-4PBGG1N:/var/www# ls -ld ~/var ~/var/www ~/var/www/html
ls: cannot access '/root/var': No such file or directory
ls: cannot access '/root/var/www': No such file or directory
ls: cannot access '/root/var/www/html': No such file or directory

最佳答案

首先,apache 服务器的目录不在根目录中,它只是“/var/www/html”。如果它仍然不起作用,您可能没有安装 apache,您可以通过运行这两行“lsb_release -a”和“sudo apt-get install apache2”来完成此操作。尝试启动 apache 服务器时会出现错误(使用“sudo service apache2 start”),但只要忽略它,您仍然可以毫无问题地使用它。希望它有帮助;)

关于linux - cp : target '/root/var/www/html/' is not a directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57029976/

相关文章:

python - 为什么 Python 为短于文件系统限制的文件名给出 "OSError: [Errno 36] File name too long"?

linux - 获取文件的内容并搜索 unix 中特定目录中的所有文件中的内容

c++ - 在 Ubuntu 12.10 上使用 C++ 通过 TCP 聊天程序有问题

linux - 如何从终端获取 CSV 尺寸

linux - 我想计算在 C 中调用了多少次系统调用

linux - 模拟 WORM 媒体

java - Android screenshot2 Linux 上的工具 NullPointerException

shell - 从文件中读取随机行的简单方法是什么?

linux - bash - 命令行中的for循环

python - 同时控制步进电机和相机