-1

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 {};

Dalia Shouman
  • 57
  • 1
  • 3
  • 6

2 Answers2

1

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 {} \;
Bram
  • 2,459
0

... 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 ; .

tbrugere
  • 996