出于某种原因,>
找不到文件test.txt,但是ls
却找到了。
$ docker exec mycont ls /headless/Desktop
test.txt
$ docker exec mycont ls /headless/Desktop > /headless/Desktop/test.txt
-bash: /headless/Desktop/test.txt: No such file or directory
答案 0 :(得分:1)
docker exec mycont bash -c "ls /headless/Desktop > /headless/Desktop/test.txt"
您希望docker在容器中而不是在主机上查找文件