Files
Single Files
Create an empty PDF file for testing:
echo -e "%PDF-1.4\n%%EOF" > empty.pdfRead the file:
$ pdftotext example.pdf - | less
$ pdf2txt example.pdf -o -Examime the file's metadata:
# Full deep metadata & forensic use
exiftool example.pdf
# Fast, readable metadata
pdfinfo example.pdf# Unzip to a directory
unzip file.xlsx -d file
# Covert to csv
xlsx2csv file.xlsx output.csv$ xmllint --format file.xmlArchives
An archive is a single file that contains multiple files or folders bundled together, often preserving their directory structure, metadata, and permissions. Examples are .zip, .tar, .7z, .rar, etc.
A ZIP file is a widely used compressed archive format that bundles multiple files into one while reducing their size for easier storage and transfer.
# Extract files
unzip example.zipIf compatibility issues with zip...
$ unzip example.zip
Archive: example.zip
skipping: joomla/.DS_Store need PK compat. v5.1 (can do v4.6)Try with 7z!
A 7z file is a compressed archive format created by the 7-Zip utility that supports high compression ratios and advanced features like encryption and multi-volume archives.
# Extract files
$ 7z x example.zipA JAR file is a package that bundles Java program files and resources into one compressed file. It's used to distribute and run Java applications or libraries easily across different systems.
jar xf yourfile.jar
unzip yourfile.jar -d output_folderA tar file is an archive file format used to bundle multiple files and directories into a single file without compression, commonly for backup or distribution purposes.
# Extract files
tar -xvf file.tarCompressed Files
A compressed file is a file whose size has been reduced using an algorithm (e.g., DEFLATE, gzip, bzip2). It contains one file that’s been made smaller. Examples are .gz, .bz2, .xz, etc.
Extract files:
# Single file
gzip -d file.gz
gunzip file.gz
# Archive
tar -xzf archive.tar.gzLast updated
Was this helpful?