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

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

我试过cp /bin* b ,但我没有成功。

使用:

 cp /bin/[bB]* ~/tolocation 

正确的命令是:

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

您可能会收到此错误:

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

那是因为应该没有以’B’开头的文件。 不过你不用担心。