【问题标题】:missing file operand cp after susu 后缺少文件操作数 cp
【发布时间】:2013-08-01 11:28:07
【问题描述】:

我在 ubuntu 上运行这个命令:

su - test -c cp /home/test/toto.txt /home/test/dir

但是我有这个错误!

cp: missing file operand

有人知道这个问题吗? 谢谢

【问题讨论】:

  • 如果我说,“用 sudo 代替 su”,那也没用吧?

标签: linux ubuntu copy cp su


【解决方案1】:

选项-c 被命令su 理解,将下一个 参数(不是剩余的)作为命令。下一个命令就是cp

尝试将命令放在引号中:

su - test -c 'cp /home/test/toto.txt /home/test/dir'

如果这是因为您想在命令中包含引号而导致问题,请尝试使用转义 而不是 内部引号:

su - test -c 'echo hello\ \ there'

【讨论】:

  • 你的意思是这样吗?:su - test cp /home/test/toto.txt /home/test/dir
猜你喜欢
  • 2013-12-17
  • 1970-01-01
  • 2018-09-12
  • 1970-01-01
  • 2018-11-16
  • 1970-01-01
  • 2013-01-10
  • 2013-05-14
  • 1970-01-01
相关资源
最近更新 更多