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

Adr*_*rge 16 command-line

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

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

Sym*_*min 29

用:

cp /bin/[bB]* ~/tolocation
Run Code Online (Sandbox Code Playgroud)


And*_*ini 12

正确的命令是:

cp /bin/b* /bin/B* destination
Run Code Online (Sandbox Code Playgroud)

您可能会收到此错误:

cp: cannot stat ‘/bin/B*’: No such file or directory
Run Code Online (Sandbox Code Playgroud)

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