If you have Java installed, you can use the free Apache Tika tool to check file metadata.
Setup after boot:
alias tika='java -jar /opt/java_shared/tika/tika-app-1.7.jar'
analyze file (slow, takes ~ 5 seconds)
tika -m chroma-1.15.tar.bz2 Content-Length: 2690725 Content-Type: application/x-bzip2 X-Parsed-By: org.apache.tika.parser.DefaultParser X-Parsed-By: org.apache.tika.parser.pkg.CompressorParser resourceName: chroma-1.15.tar.bz2
Another example:
echo "hi there" > notazipfile.zip tika -m notazipfile.zip Content-Encoding: ISO-8859-1 Content-Length: 9 Content-Type: text/plain; charset=ISO-8859-1 X-Parsed-By: org.apache.tika.parser.DefaultParser X-Parsed-By: org.apache.tika.parser.txt.TXTParser resourceName: notazipfile.zip
There is a help page:
tika --help
Long list:
tika --list-supported-types | grep -C 3 bzip2 application/x-bzip supertype: application/octet-stream parser: org.apache.tika.parser.pkg.CompressorParser
Again: checking for large files may take some time.
Please note that there is a website on which someone started to create an R-interface, but this webpage has been seemingly inactive since 2012: https://r-forge.r-project.org/projects/r- tika /
source share