How can I copy all files which starts with "b" or "B" from /bin to a specific folder?

How can I copy all files which starts with "b" or "B" from /bin to a specific folder?

I tried cp /bin* b , but I didn't succeed.


Solution 1:

Use:

cp /bin/[bB]* ~/tolocation

Solution 2:

The right command is:

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

You will probably get this error:

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

That's because there should be no files starting with 'B'. However you shouldn't worry.