I have a huge list of tbz files, approximately 1000 tbz, which I want to UNZIP TO dm4 files. How do I go about it one shot.
for archive in *.tbz; do tar -x -j -f "$archive" done
This would attempt to extract all the files matching
*.tbz in the current directory. It is assumed that each such file is a
To see the files while they are extracted, use
tar with its
for archive in *.tbz; do tar -x -vj -f "$archive" done
With another implementation of
tar that does not implement
-j for handling
bzip2-compressed data, you would have to decompress the archives separately:
for archive in *.tbz; do bzcat "$archive" | tar -x -v -f - done
This would obviously work with GNU
tar as well.
bzcat could be replaced by
bzip2 -d -c.
To extract the files to another directory than the current one, use
-C destdir with
for archive in *.tbz; do tar -x -j -f "$archive" -C destdir done
This assumes that you want to put the files into the directory called
destdir in the current directory.