file — determining file type
cheat sheet · Linux https://lab.dimsanych.ru/en/wiki/file/Cheat sheet
-
file ftype by content -
file -i fMIME + encoding -
file -b ftype only (for scripts) -
file -s /dev/sda1filesystem 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).