如何将所有以“ b”或“ B”开头的文件从/ bin复制到特定文件夹?


Answers:


26

采用:

cp /bin/[bB]* ~/tolocation

1
有人在乎为什么说-1吗?
Symin

非常简短地看到了-1-现在不见了。
gertvdijk

我宁愿“ cp -p”,而不只是“ cp” ...
Olivier Dulac

我更喜欢使用cp /bin/[bB]* ~/tolocation/,以确保〜/ tolocation是目录而不是文件。
赞恩2014年

12

正确的命令是:

cp /bin/b* /bin/B* destination

您可能会收到此错误:

cp: cannot stat ‘/bin/B*’: No such file or directory

那是因为应该没有以“ B”开头的文件。但是,您不必担心。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.