Command-Line Inspection, Hex Analysis and Validation Tools Across 54 Formats: Questions and Answers
Engineering reference answering 100 distinct technical questions on inspecting headers, verifying structure, dumping hex offsets, and validating integrity from bash, zsh, and Windows PowerShell across all 54 file formats across all 54 file formats supported by SampleTestFiles.
Representative format hubs and diagnostic tools
Part 1: Document, spreadsheet and text format questions
- 1. Which command-line tools and flags inspect the binary header and structural validity of a .avro (Avro) file?
- First inspect the magic signature (4F 62 6A 01) with xxd -g 1 -l 64 sample-avro-1kb.avro or Format-Hex -Count 64 sample-avro-1kb.avro in PowerShell, then invoke PySpark to check Extension (.avro).
- 2. Which command-line tools and flags inspect the binary header and structural validity of a .bin (BIN) file?
- First inspect the magic signature (None) with xxd -g 1 -l 64 sample-bin-1kb.bin or Format-Hex -Count 64 sample-bin-1kb.bin in PowerShell, then invoke Node.js Buffer to check MIME type (application/octet-stream).
- 3. Which command-line tools and flags inspect the binary header and structural validity of a .bmp (BMP) file?
- First inspect the magic signature (42 4D) with xxd -g 1 -l 64 sample-bmp-10kb.bmp or Format-Hex -Count 64 sample-bmp-10kb.bmp in PowerShell, then invoke and OpenCV to check Header (BITMAPFILEHEADER and a DIB header).
- 4. Which command-line tools and flags inspect the binary header and structural validity of a .css (CSS) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-css-1kb.css or Format-Hex -Count 64 sample-css-1kb.css in PowerShell, then invoke PostCSS to check Encoding (UTF-8).
- 5. Which command-line tools and flags inspect the binary header and structural validity of a .csv (CSV) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-csv-1kb.csv or Format-Hex -Count 64 sample-csv-1kb.csv in PowerShell, then invoke PapaParse to check Quoting (Double quotes, doubled to escape).
- 6. Which command-line tools and flags inspect the binary header and structural validity of a .docx (DOCX) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-docx-50kb.docx or Format-Hex -Count 64 sample-docx-50kb.docx in PowerShell, then invoke Mammoth.js to check Macros (Not allowed in .docx; macro-enabled documents use .docm).
- 7. Which command-line tools and flags inspect the binary header and structural validity of a .eml (EML) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-eml-1kb.eml or Format-Hex -Count 64 sample-eml-1kb.eml in PowerShell, then invoke Thunderbird to check Extension (.eml).
- 8. Which command-line tools and flags inspect the binary header and structural validity of a .epub (EPUB) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-epub-10kb.epub or Format-Hex -Count 64 sample-epub-10kb.epub in PowerShell, then invoke Apple Books to check MIME type (application/epub+zip).
- 9. Which command-line tools and flags inspect the binary header and structural validity of a .flac (FLAC) file?
- First inspect the magic signature (66 4C 61 43) with xxd -g 1 -l 64 sample-flac-100kb.flac or Format-Hex -Count 64 sample-flac-100kb.flac in PowerShell, then invoke Mutagens to check MIME type (audio/flac).
- 10. Which command-line tools and flags inspect the binary header and structural validity of a .geojson (GeoJSON) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-geojson-1kb.geojson or Format-Hex -Count 64 sample-geojson-1kb.geojson in PowerShell, then invoke and Shapely to check Coordinate order (Longitude, latitude, optional elevation).
- 11. Which command-line tools and flags inspect the binary header and structural validity of a .gif (GIF) file?
- First inspect the magic signature (47 49 46 38 39 61) with xxd -g 1 -l 64 sample-gif-10kb.gif or Format-Hex -Count 64 sample-gif-10kb.gif in PowerShell, then invoke giflib to check Colour (Up to 256 colours per frame from a 24-bit palette).
- 12. Which command-line tools and flags inspect the binary header and structural validity of a .gltf (glTF) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-gltf-1kb.gltf or Format-Hex -Count 64 sample-gltf-1kb.gltf in PowerShell, then invoke Khronos glTF-Validator to check Binary form (.glb, with the media type model/gltf-binary).
- 13. Which command-line tools and flags inspect the binary header and structural validity of a .gpx (GPX) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-gpx-1kb.gpx or Format-Hex -Count 64 sample-gpx-1kb.gpx in PowerShell, then invoke and GPSBabel to check Coordinates (lat and lon attributes, decimal degrees, WGS 84).
- 14. Which command-line tools and flags inspect the binary header and structural validity of a .gz (GZ) file?
- First inspect the magic signature (1F 8B 08) with xxd -g 1 -l 64 sample-gz-1kb.gz or Format-Hex -Count 64 sample-gz-1kb.gz in PowerShell, then invoke GNU gzip/zcat to check Optional header fields (Original file name, comment, extra data).
- 15. Which command-line tools and flags inspect the binary header and structural validity of a .html (HTML) file?
- First inspect the magic signature (3C 21 44 4F 43 54 59 50 45) with xxd -g 1 -l 64 sample-html-1kb.html or Format-Hex -Count 64 sample-html-1kb.html in PowerShell, then invoke WebKit) to check Standard (HTML Living Standard (WHATWG)).
- 16. Which command-line tools and flags inspect the binary header and structural validity of a .ico (ICO) file?
- First inspect the magic signature (00 00 01 00) with xxd -g 1 -l 64 sample-ico-10kb.ico or Format-Hex -Count 64 sample-ico-10kb.ico in PowerShell, then invoke ImageMagick to check MIME type (image/vnd.microsoft.icon).
- 17. Which command-line tools and flags inspect the binary header and structural validity of a .ics (iCalendar) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-ics-1kb.ics or Format-Hex -Count 64 sample-ics-1kb.ics in PowerShell, then invoke Google Calendar to check Line folding (Lines longer than 75 octets continue on the next line after a space).
- 18. Which command-line tools and flags inspect the binary header and structural validity of a .ini (INI) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-ini-1kb.ini or Format-Hex -Count 64 sample-ini-1kb.ini in PowerShell, then invoke and systemd unit parsers to check Nesting (One level of sections).
- 19. Which command-line tools and flags inspect the binary header and structural validity of a .jpg (JPG) file?
- First inspect the magic signature (FF D8 FF) with xxd -g 1 -l 64 sample-jpg-1kb.jpg or Format-Hex -Count 64 sample-jpg-1kb.jpg in PowerShell, then invoke MozJPEG to check Extension (.jpg).
- 20. Which command-line tools and flags inspect the binary header and structural validity of a .js (JavaScript) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-js-1kb.js or Format-Hex -Count 64 sample-js-1kb.js in PowerShell, then invoke Terser to check Module systems (ECMAScript modules and CommonJS).
- 21. Which command-line tools and flags inspect the binary header and structural validity of a .json (JSON) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-json-1kb.json or Format-Hex -Count 64 sample-json-1kb.json in PowerShell, then invoke jq to check Standard (RFC 8259 and ECMA-404).
- 22. Which command-line tools and flags inspect the binary header and structural validity of a .jsonl (JSONL) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-jsonl-1kb.jsonl or Format-Hex -Count 64 sample-jsonl-1kb.jsonl in PowerShell, then invoke and Node.js readline + JSON.parse to check Extension (.jsonl).
- 23. Which command-line tools and flags inspect the binary header and structural validity of a .kml (KML) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-kml-1kb.kml or Format-Hex -Count 64 sample-kml-1kb.kml in PowerShell, then invoke and fastkml to check Coordinate order (Longitude, latitude, altitude).
- 24. Which command-line tools and flags inspect the binary header and structural validity of a .log (LOG) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-log-1kb.log or Format-Hex -Count 64 sample-log-1kb.log in PowerShell, then invoke Fluentd to check Growth (Append-only; rotated and compressed by tools such as logrotate).
- 25. Which command-line tools and flags inspect the binary header and structural validity of a .m4a (M4A) file?
- First inspect the magic signature (66 74 79 70 4D 34 41 20 at byte offset 4) with xxd -g 1 -l 64 sample-m4a-100kb.m4a or Format-Hex -Count 64 sample-m4a-100kb.m4a in PowerShell, then invoke Apple CoreAudio to check Container (ISO base media file format (ISO/IEC 14496-12)).
Part 2: Image, audio, video, archive and 3D format questions
- 1. Which command-line tools and flags inspect the binary header and structural validity of a .md (Markdown) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-md-1kb.md or Format-Hex -Count 64 sample-md-1kb.md in PowerShell, then invoke Goldmark (Go) to check MIME type (text/markdown).
- 2. Which command-line tools and flags inspect the binary header and structural validity of a .mkv (MKV) file?
- First inspect the magic signature (1A 45 DF A3) with xxd -g 1 -l 64 sample-mkv-100kb.mkv or Format-Hex -Count 64 sample-mkv-100kb.mkv in PowerShell, then invoke MPV to check Codecs (Almost any: H.264, HEVC, AV1, VP9, AAC, FLAC, Opus and more).
- 3. Which command-line tools and flags inspect the binary header and structural validity of a .mov (MOV) file?
- First inspect the magic signature (66 74 79 70 71 74 20 20 at byte offset 4) with xxd -g 1 -l 64 sample-mov-100kb.mov or Format-Hex -Count 64 sample-mov-100kb.mov in PowerShell, then invoke FFmpeg to check Structure (Atoms: ftyp, moov, mdat).
- 4. Which command-line tools and flags inspect the binary header and structural validity of a .mp3 (MP3) file?
- First inspect the magic signature (49 44 33) with xxd -g 1 -l 64 sample-mp3-100kb.mp3 or Format-Hex -Count 64 sample-mp3-100kb.mp3 in PowerShell, then invoke libmpg123 to check Frame length (1,152 samples).
- 5. Which command-line tools and flags inspect the binary header and structural validity of a .mp4 (MP4) file?
- First inspect the magic signature (66 74 79 70 at byte offset 4) with xxd -g 1 -l 64 sample-mp4-100kb.mp4 or Format-Hex -Count 64 sample-mp4-100kb.mp4 in PowerShell, then invoke GPAC MP4Box to check Streaming (Supports HTTP range requests and fragmentation).
- 6. Which command-line tools and flags inspect the binary header and structural validity of a .obj (OBJ) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-obj-1kb.obj or Format-Hex -Count 64 sample-obj-1kb.obj in PowerShell, then invoke Assimp to check Extension (.obj).
- 7. Which command-line tools and flags inspect the binary header and structural validity of a .ods (ODS) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-ods-10kb.ods or Format-Hex -Count 64 sample-ods-10kb.ods in PowerShell, then invoke Pandas (odf engine) to check MIME type (application/vnd.oasis.opendocument.spreadsheet).
- 8. Which command-line tools and flags inspect the binary header and structural validity of a .odt (ODT) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-odt-10kb.odt or Format-Hex -Count 64 sample-odt-10kb.odt in PowerShell, then invoke and Apache ODF Toolkit to check Standard (OASIS OpenDocument 1.3; ISO/IEC 26300).
- 9. Which command-line tools and flags inspect the binary header and structural validity of a .pdf (PDF) file?
- First inspect the magic signature (25 50 44 46 2D) with xxd -g 1 -l 64 sample-pdf-5kb.pdf or Format-Hex -Count 64 sample-pdf-5kb.pdf in PowerShell, then invoke and MuPDF to check Structure (Header, body objects, cross-reference table, trailer).
- 10. Which command-line tools and flags inspect the binary header and structural validity of a .png (PNG) file?
- First inspect the magic signature (89 50 4E 47 0D 0A 1A 0A) with xxd -g 1 -l 64 sample-png-1kb.png or Format-Hex -Count 64 sample-png-1kb.png in PowerShell, then invoke libpng to check Colour (Greyscale, palette or truecolour, 1 to 16 bits per channel).
- 11. Which command-line tools and flags inspect the binary header and structural validity of a .pptx (PPTX) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-pptx-100kb.pptx or Format-Hex -Count 64 sample-pptx-100kb.pptx in PowerShell, then invoke Apache POI XSLF to check Macros (Not allowed in .pptx; macro-enabled files use .pptm).
- 12. Which command-line tools and flags inspect the binary header and structural validity of a .rtf (RTF) file?
- First inspect the magic signature (7B 5C 72 74 66 31) with xxd -g 1 -l 64 sample-rtf-1kb.rtf or Format-Hex -Count 64 sample-rtf-1kb.rtf in PowerShell, then invoke Pandoc to check MIME type (application/rtf).
- 13. Which command-line tools and flags inspect the binary header and structural validity of a .sql (SQL) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-sql-1kb.sql or Format-Hex -Count 64 sample-sql-1kb.sql in PowerShell, then invoke sqlparse to check MIME type (application/sql).
- 14. Which command-line tools and flags inspect the binary header and structural validity of a .srt (SRT) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-srt-1kb.srt or Format-Hex -Count 64 sample-srt-1kb.srt in PowerShell, then invoke FFmpeg to check Specification (None; a de facto standard).
- 15. Which command-line tools and flags inspect the binary header and structural validity of a .stl (STL) file?
- First inspect the magic signature (73 6F 6C 69 64) with xxd -g 1 -l 64 sample-stl-1kb.stl or Format-Hex -Count 64 sample-stl-1kb.stl in PowerShell, then invoke and numpy-stl to check Encodings (ASCII (text) and binary).
- 16. Which command-line tools and flags inspect the binary header and structural validity of a .svg (SVG) file?
- First inspect the magic signature (3C 73 76 67) with xxd -g 1 -l 64 sample-svg-1kb.svg or Format-Hex -Count 64 sample-svg-1kb.svg in PowerShell, then invoke Browser SVG DOM to check Compressed form (.svgz (gzip)).
- 17. Which command-line tools and flags inspect the binary header and structural validity of a .tar (TAR) file?
- First inspect the magic signature (75 73 74 61 72 at byte offset 257) with xxd -g 1 -l 64 sample-tar-10kb.tar or Format-Hex -Count 64 sample-tar-10kb.tar in PowerShell, then invoke and node-tar to check End marker (Two blocks of zero bytes).
- 18. Which command-line tools and flags inspect the binary header and structural validity of a .tiff (TIFF) file?
- First inspect the magic signature (49 49 2A 00) with xxd -g 1 -l 64 sample-tiff-10kb.tiff or Format-Hex -Count 64 sample-tiff-10kb.tiff in PowerShell, then invoke tifffile to check Extension (.tiff).
- 19. Which command-line tools and flags inspect the binary header and structural validity of a .toml (TOML) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-toml-1kb.toml or Format-Hex -Count 64 sample-toml-1kb.toml in PowerShell, then invoke toml-rs (Rust Cargo) to check MIME type (application/toml).
- 20. Which command-line tools and flags inspect the binary header and structural validity of a .tsv (TSV) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-tsv-1kb.tsv or Format-Hex -Count 64 sample-tsv-1kb.tsv in PowerShell, then invoke Pandas read_csv(sep='\t') to check Media type registration (IANA text/tab-separated-values (1993)).
- 21. Which command-line tools and flags inspect the binary header and structural validity of a .txt (TXT) file?
- First inspect the magic signature (None) with xxd -g 1 -l 64 sample-txt-1kb.txt or Format-Hex -Count 64 sample-txt-1kb.txt in PowerShell, then invoke and browser TextDecoder to check Line endings (LF on Unix and macOS, CRLF on Windows).
- 22. Which command-line tools and flags inspect the binary header and structural validity of a .vtt (WebVTT) file?
- First inspect the magic signature (57 45 42 56 54 54) with xxd -g 1 -l 64 sample-vtt-1kb.vtt or Format-Hex -Count 64 sample-vtt-1kb.vtt in PowerShell, then invoke shaka-player to check Timestamp (HH:MM:SS.mmm with a full stop before milliseconds).
- 23. Which command-line tools and flags inspect the binary header and structural validity of a .wav (WAV) file?
- First inspect the magic signature (52 49 46 46 ?? ?? ?? ?? 57 41 56 45) with xxd -g 1 -l 64 sample-wav-100kb.wav or Format-Hex -Count 64 sample-wav-100kb.wav in PowerShell, then invoke libsndfile to check Size limit (4 GB, because sizes are 32-bit).
- 24. Which command-line tools and flags inspect the binary header and structural validity of a .webm (WebM) file?
- First inspect the magic signature (1A 45 DF A3) with xxd -g 1 -l 64 sample-webm-100kb.webm or Format-Hex -Count 64 sample-webm-100kb.webm in PowerShell, then invoke FFmpeg to check Extension (.webm).
- 25. Which command-line tools and flags inspect the binary header and structural validity of a .webp (WebP) file?
- First inspect the magic signature (52 49 46 46 ?? ?? ?? ?? 57 45 42 50) with xxd -g 1 -l 64 sample-webp-10kb.webp or Format-Hex -Count 64 sample-webp-10kb.webp in PowerShell, then invoke ImageMagick to check MIME type (image/webp).
- 26. Which command-line tools and flags inspect the binary header and structural validity of a .xlsx (XLSX) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-xlsx-10kb.xlsx or Format-Hex -Count 64 sample-xlsx-10kb.xlsx in PowerShell, then invoke Calamine (Rust) to check Standard (ECMA-376 and ISO/IEC 29500).
- 27. Which command-line tools and flags inspect the binary header and structural validity of a .xml (XML) file?
- First inspect the magic signature (3C 3F 78 6D 6C) with xxd -g 1 -l 64 sample-xml-1kb.xml or Format-Hex -Count 64 sample-xml-1kb.xml in PowerShell, then invoke Python xml.etree.ElementTree and lxml to check Also seen as (text/xml).
- 28. Which command-line tools and flags inspect the binary header and structural validity of a .yaml (YAML) file?
- First inspect the magic signature (UTF-8 text) with xxd -g 1 -l 64 sample-yaml-1kb.yaml or Format-Hex -Count 64 sample-yaml-1kb.yaml in PowerShell, then invoke and yq to check Indentation (Spaces only; tabs are not allowed).
- 29. Which command-line tools and flags inspect the binary header and structural validity of a .zip (ZIP) file?
- First inspect the magic signature (50 4B 03 04) with xxd -g 1 -l 64 sample-zip-1kb.zip or Format-Hex -Count 64 sample-zip-1kb.zip in PowerShell, then invoke Info-ZIP unzip to check Compression (Deflate or none per entry; others are optional).
Part 3: Architecture, implementation and pipeline questions
- 1. How do I compare the first 64 header bytes of sample-avro-1kb.avro against the POSIX file command output?
- Run file --mime-type -b sample-avro-1kb.avro alongside head -c 64 sample-avro-1kb.avro | hexdump -C to confirm that libmagic detects application/avro from 4F 62 6A 01.
- 2. How do I compare the first 64 header bytes of sample-bin-1kb.bin against the POSIX file command output?
- Run file --mime-type -b sample-bin-1kb.bin alongside head -c 64 sample-bin-1kb.bin | hexdump -C to confirm that libmagic detects application/octet-stream from None.
- 3. How do I compare the first 64 header bytes of sample-bmp-10kb.bmp against the POSIX file command output?
- Run file --mime-type -b sample-bmp-10kb.bmp alongside head -c 64 sample-bmp-10kb.bmp | hexdump -C to confirm that libmagic detects image/bmp from 42 4D.
- 4. How do I compare the first 64 header bytes of sample-css-1kb.css against the POSIX file command output?
- Run file --mime-type -b sample-css-1kb.css alongside head -c 64 sample-css-1kb.css | hexdump -C to confirm that libmagic detects text/css from UTF-8 text.
- 5. How do I compare the first 64 header bytes of sample-csv-1kb.csv against the POSIX file command output?
- Run file --mime-type -b sample-csv-1kb.csv alongside head -c 64 sample-csv-1kb.csv | hexdump -C to confirm that libmagic detects text/csv from UTF-8 text.
- 6. How do I compare the first 64 header bytes of sample-docx-50kb.docx against the POSIX file command output?
- Run file --mime-type -b sample-docx-50kb.docx alongside head -c 64 sample-docx-50kb.docx | hexdump -C to confirm that libmagic detects application/vnd.openxmlformats-officedocument.wordprocessingml.document from 50 4B 03 04.
- 7. How do I compare the first 64 header bytes of sample-eml-1kb.eml against the POSIX file command output?
- Run file --mime-type -b sample-eml-1kb.eml alongside head -c 64 sample-eml-1kb.eml | hexdump -C to confirm that libmagic detects message/rfc822 from UTF-8 text.
- 8. How do I compare the first 64 header bytes of sample-epub-10kb.epub against the POSIX file command output?
- Run file --mime-type -b sample-epub-10kb.epub alongside head -c 64 sample-epub-10kb.epub | hexdump -C to confirm that libmagic detects application/epub+zip from 50 4B 03 04.
- 9. How do I compare the first 64 header bytes of sample-flac-100kb.flac against the POSIX file command output?
- Run file --mime-type -b sample-flac-100kb.flac alongside head -c 64 sample-flac-100kb.flac | hexdump -C to confirm that libmagic detects audio/flac from 66 4C 61 43.
- 10. How do I compare the first 64 header bytes of sample-geojson-1kb.geojson against the POSIX file command output?
- Run file --mime-type -b sample-geojson-1kb.geojson alongside head -c 64 sample-geojson-1kb.geojson | hexdump -C to confirm that libmagic detects application/geo+json from UTF-8 text.
- 11. How do I compare the first 64 header bytes of sample-gif-10kb.gif against the POSIX file command output?
- Run file --mime-type -b sample-gif-10kb.gif alongside head -c 64 sample-gif-10kb.gif | hexdump -C to confirm that libmagic detects image/gif from 47 49 46 38 39 61.
- 12. How do I compare the first 64 header bytes of sample-gltf-1kb.gltf against the POSIX file command output?
- Run file --mime-type -b sample-gltf-1kb.gltf alongside head -c 64 sample-gltf-1kb.gltf | hexdump -C to confirm that libmagic detects model/gltf+json from UTF-8 text.
- 13. How do I compare the first 64 header bytes of sample-gpx-1kb.gpx against the POSIX file command output?
- Run file --mime-type -b sample-gpx-1kb.gpx alongside head -c 64 sample-gpx-1kb.gpx | hexdump -C to confirm that libmagic detects application/gpx+xml from UTF-8 text.
- 14. How do I compare the first 64 header bytes of sample-gz-1kb.gz against the POSIX file command output?
- Run file --mime-type -b sample-gz-1kb.gz alongside head -c 64 sample-gz-1kb.gz | hexdump -C to confirm that libmagic detects application/gzip from 1F 8B 08.
- 15. How do I compare the first 64 header bytes of sample-html-1kb.html against the POSIX file command output?
- Run file --mime-type -b sample-html-1kb.html alongside head -c 64 sample-html-1kb.html | hexdump -C to confirm that libmagic detects text/html from 3C 21 44 4F 43 54 59 50 45.
- 16. How do I compare the first 64 header bytes of sample-favicon.ico against the POSIX file command output?
- Run file --mime-type -b sample-favicon.ico alongside head -c 64 sample-favicon.ico | hexdump -C to confirm that libmagic detects image/vnd.microsoft.icon from 00 00 01 00.
- 17. How do I compare the first 64 header bytes of sample-ics-1kb.ics against the POSIX file command output?
- Run file --mime-type -b sample-ics-1kb.ics alongside head -c 64 sample-ics-1kb.ics | hexdump -C to confirm that libmagic detects text/calendar from UTF-8 text.
- 18. How do I compare the first 64 header bytes of sample-ini-1kb.ini against the POSIX file command output?
- Run file --mime-type -b sample-ini-1kb.ini alongside head -c 64 sample-ini-1kb.ini | hexdump -C to confirm that libmagic detects text/plain from UTF-8 text.
- 19. How do I compare the first 64 header bytes of sample-jpg-1kb.jpg against the POSIX file command output?
- Run file --mime-type -b sample-jpg-1kb.jpg alongside head -c 64 sample-jpg-1kb.jpg | hexdump -C to confirm that libmagic detects image/jpeg from FF D8 FF.
- 20. How do I compare the first 64 header bytes of sample-js-1kb.js against the POSIX file command output?
- Run file --mime-type -b sample-js-1kb.js alongside head -c 64 sample-js-1kb.js | hexdump -C to confirm that libmagic detects text/javascript, per RFC 9239 from UTF-8 text.
- 21. How do I compare the first 64 header bytes of sample-json-1kb.json against the POSIX file command output?
- Run file --mime-type -b sample-json-1kb.json alongside head -c 64 sample-json-1kb.json | hexdump -C to confirm that libmagic detects application/json from UTF-8 text.
- 22. How do I compare the first 64 header bytes of sample-jsonl-1kb.jsonl against the POSIX file command output?
- Run file --mime-type -b sample-jsonl-1kb.jsonl alongside head -c 64 sample-jsonl-1kb.jsonl | hexdump -C to confirm that libmagic detects application/jsonl from UTF-8 text.
- 23. How do I compare the first 64 header bytes of sample-kml-1kb.kml against the POSIX file command output?
- Run file --mime-type -b sample-kml-1kb.kml alongside head -c 64 sample-kml-1kb.kml | hexdump -C to confirm that libmagic detects application/vnd.google-earth.kml+xml from UTF-8 text.
Part 4: Verification, edge cases and automation questions
- 1. How can I assert in a shell script that a generated .avro file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-avro-1mb.avro (or (Get-Item sample-avro-1mb.avro).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-avro-1mb.avro | xxd.
- 2. How can I assert in a shell script that a generated .bin file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-bin-1mb.bin (or (Get-Item sample-bin-1mb.bin).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-bin-1mb.bin | xxd.
- 3. How can I assert in a shell script that a generated .bmp file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-bmp-1mb.bmp (or (Get-Item sample-bmp-1mb.bmp).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-bmp-1mb.bmp | xxd.
- 4. How can I assert in a shell script that a generated .css file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-css-1mb.css (or (Get-Item sample-css-1mb.css).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-css-1mb.css | xxd.
- 5. How can I assert in a shell script that a generated .csv file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-csv-1mb.csv (or (Get-Item sample-csv-1mb.csv).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-csv-1mb.csv | xxd.
- 6. How can I assert in a shell script that a generated .docx file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-docx-1mb.docx (or (Get-Item sample-docx-1mb.docx).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-docx-1mb.docx | xxd.
- 7. How can I assert in a shell script that a generated .eml file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-eml-1mb.eml (or (Get-Item sample-eml-1mb.eml).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-eml-1mb.eml | xxd.
- 8. How can I assert in a shell script that a generated .epub file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-epub-1mb.epub (or (Get-Item sample-epub-1mb.epub).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-epub-1mb.epub | xxd.
- 9. How can I assert in a shell script that a generated .flac file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-flac-1mb.flac (or (Get-Item sample-flac-1mb.flac).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-flac-1mb.flac | xxd.
- 10. How can I assert in a shell script that a generated .geojson file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-geojson-1mb.geojson (or (Get-Item sample-geojson-1mb.geojson).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-geojson-1mb.geojson | xxd.
- 11. How can I assert in a shell script that a generated .gif file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-gif-1mb.gif (or (Get-Item sample-gif-1mb.gif).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-gif-1mb.gif | xxd.
- 12. How can I assert in a shell script that a generated .gltf file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-gltf-1mb.gltf (or (Get-Item sample-gltf-1mb.gltf).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-gltf-1mb.gltf | xxd.
- 13. How can I assert in a shell script that a generated .gpx file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-gpx-1mb.gpx (or (Get-Item sample-gpx-1mb.gpx).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-gpx-1mb.gpx | xxd.
- 14. How can I assert in a shell script that a generated .gz file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-gz-1mb.gz (or (Get-Item sample-gz-1mb.gz).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-gz-1mb.gz | xxd.
- 15. How can I assert in a shell script that a generated .html file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-html-1mb.html (or (Get-Item sample-html-1mb.html).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-html-1mb.html | xxd.
- 16. How can I assert in a shell script that a generated .ico file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-ico-1mb.ico (or (Get-Item sample-ico-1mb.ico).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-ico-1mb.ico | xxd.
- 17. How can I assert in a shell script that a generated .ics file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-ics-1mb.ics (or (Get-Item sample-ics-1mb.ics).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-ics-1mb.ics | xxd.
- 18. How can I assert in a shell script that a generated .ini file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-ini-1mb.ini (or (Get-Item sample-ini-1mb.ini).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-ini-1mb.ini | xxd.
- 19. How can I assert in a shell script that a generated .jpg file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-jpg-1mb.jpg (or (Get-Item sample-jpg-1mb.jpg).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-jpg-1mb.jpg | xxd.
- 20. How can I assert in a shell script that a generated .js file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-js-1mb.js (or (Get-Item sample-js-1mb.js).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-js-1mb.js | xxd.
- 21. How can I assert in a shell script that a generated .json file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-json-1mb.json (or (Get-Item sample-json-1mb.json).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-json-1mb.json | xxd.
- 22. How can I assert in a shell script that a generated .jsonl file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-jsonl-1mb.jsonl (or (Get-Item sample-jsonl-1mb.jsonl).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-jsonl-1mb.jsonl | xxd.
- 23. How can I assert in a shell script that a generated .kml file has the exact expected byte count and non-empty trailer?
- Use wc -c < sample-kml-1mb.kml (or (Get-Item sample-kml-1mb.kml).Length in PowerShell) to assert 1,048,576 bytes, and inspect the final 64 bytes with tail -c 64 sample-kml-1mb.kml | xxd.
Explore all 40 topic-based technical format references
Browse the complete engineering reference library on Testing guides or Frequently asked questions.