Artificial intelligent assistant

Difference between .bz2 and .tar.bz2 files I am supposed to find whether a file is compressed using .bz2 or .tar.bz2(without using extension of file) and and decompress it accordingly. I used the `file` command but it is giving same result for both .bz2 and .tar.bz2. Please suggest a way to identify .bz2 and .tar.bz2 files distinctly.

Run the file through `bzcat` and pipe the result to `file`:


$ bzcat somefile.bz2 | file -
/dev/stdin: data # or whatever; this is not a .tar.bz2

$ bzcat otherfile.bz2 | file -
/dev/stdin: POSIX tar archive # this *is* a .tar.bz2

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8ef82c04fcf481c06958762087406d4e