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.
我使用此命令从服务器复制名称以“文件”开头的所有文件。scp -vp me@server:/location/files* ./
但我得到了一个“不匹配”的错误。可能与命令中的“”有关。我如何保护ssh 的“”以了解这指的是文件列表而不是将其作为文件名。
谢谢八月
外壳本身正在扩展*. 您可以通过引用它或使用反斜杠来避免它,以防止 shell 解释它,而是直接将它传递给scp:
*
scp
scp -vp me@server:/location/files\*
如果您希望文件以 file 开头,那么它应该是
scp me@server:/location/file* .
不是
文件*