Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
cp /bin/b* /to_folder/ should work – SimplySimon Aug 26 '13 at 18:22
up vote 15 down vote accepted


cp /bin/[bB]* ~/tolocation
share|improve this answer
Anyone care to say why the -1? – Symin Aug 26 '13 at 18:24
Saw the -1 very briefly - it is gone now. – gertvdijk Aug 26 '13 at 18:25
i'd rather "cp -p" than just "cp" ... – Olivier Dulac Aug 27 '13 at 9:10
I prefer to use cp /bin/[bB]* ~/tolocation/, to ensure that ~/tolocation is a directory and not a file. – Zane Mar 19 '14 at 10:21

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.