-1

I have a folder. In this folder I have a lot of other folders. In folders I have bzip files and non-bzip. How to unarchieve all bzip2 files in same directory where they are ?

1

If your bzip2 files have the standard bz2 extension, try this:

find some_dir_with_bzip2_files -name *.bz2 -exec bunzip2 {} \;

Full example:

$ tree a
a
├── b
│   ├── d
│   ├── file.four
│   └── file.three
├── c
│   └── e
│       ├── file.seven.bz2
│       └── file.six.bz2
├── file.one.bz2
└── file.two.bz2

$ find a -name *.bz2 -exec bunzip2 {} \;

$ tree a
a
├── b
│   ├── d
│   ├── file.four
│   └── file.three
├── c
│   └── e
│       ├── file.seven
│       └── file.six
├── file.one
└── file.two

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.