I try to extract all files in all sub directories by this command

 $ find -name "*.bz2" -print  -exec bizp2 -d "*.bz2" {}\;
find: missing argument to `-exec'

but it doesnot work :(

btw I do not understand the usage of {};

  • your command bizp2 what should it do? Is that related to bzip2? – Anthon Oct 3 '15 at 19:23

There are two errors in your command:

  • leave out the "*bz2" option to bzip2, the {} will be replaced by any file find returns
  • add a space between {} and \;

so the full command would be

 find -name "*bz2" -print -exec bzip2 -d {} \;
  • it works , thaaaanks a lot (Y) – Dalia Shouman Oct 3 '15 at 18:26

... I don't understand your command... I would just have used :

 find -name *.bz2 -exec bzip2 -d '{}'  ';'

I don't understand why you put "*.bz2". According to

 man find

you should put the thing in quotes '' because the {} could get interpreted by the shell. With a bit of testing, I think I can conclude the problem lies with the fact that you put no space between {} and \; whereas the man page specifies that the last argument should consist solely of ; .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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