Where to start First steps track · 15 stages
Linux Labs

file — determining file type

cheat sheet · Linux https://lab.dimsanych.ru/en/wiki/file/

Cheat sheet

  • file f type by content
  • file -i f MIME + encoding
  • file -b f type only (for scripts)
  • file -s /dev/sda1 filesystem type on a device (as root)

Options

-b (brief, no filename), -i (MIME type and encoding), -L (follow a symlink and look at its target, not the link itself), -s (look inside special files/block devices — otherwise file just says "block special"), -z (look inside a compressed file instead of just identifying it's gzip).

Loading…