Uncompress Files Compressed with bzip2bunzip2In the same way that bzip2 was purposely designed to emulate gzip as closely as possible, the way bunzip2 works is very close to that of gunzip. $ ls -l -rw-r--r-- scott scott 367248 moby-dick.txt.bz2 $ bunzip2 moby-dick.txt.bz2 $ ls -l -rw-r--r-- scott scott 1236574 moby-dick.txt You'll notice that bunzip2 is similar to gunzip in another way: Both commands remove the original compressed file, leaving you with the final uncompressed result. If you want to ensure that you have both the compressed and uncompressed files, you need to use the -c option (or --stdout or --to-stdout) and pipe the results to the file you want to create. $ ls -l -rw-r--r-- scott scott 367248 moby-dick.txt.bz2 $ bunzip2 -c moby-dick.txt.bz2 > moby-dick.txt $ ls -l -rw-r--r-- scott scott 1236574 moby-dick.txt -rw-r--r-- scott scott 367248 moby-dick.txt.bz2 It's a good thing when commands copy each other's options and behavior, as it makes them easier to learn. In this, the creators of bzip2 and bunzip2 showed remarkable foresight. Note If you're not feeling favorable toward bunzip2, you can also use bzip2 -d (or --decompress or --uncompress). |