Linux

file

SafeIdentify file type

file <path>

Detects the file type from content, not extension. Handy for encodings and binary formats.

Examples

  • file -i report.csvMIME type and charset

Syntax

file <path>

Before you run it

Read only.

Used when you see

Fixing mojibake
1
Detect the file's actual encoding
See the whole flow →

Related commands

  • statFile status details
  • catPrint file contents

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store