Linux Commands / IT Support Guides
Identify an unknown Linux file with file
A filename extension can be misleading when an upload or log viewer refuses to open a file. Inspect its detected type before choosing a parser.
Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution
Try the diagnostic command
Use the stated shell and platform. Replace sample domains, addresses, services and paths with values from the system you are authorized to support.
file -- /tmp/support-sample
How to read the result
The utility examines content signatures and other indicators to describe the file. It may identify compressed data, executable content or a text encoding rather than the type suggested by the name.
What to do next
Replace the path with the actual sample and compare the result with the expected export format. Use an appropriate viewer and retain the original file unchanged for investigation.
Before you make a change
Detection is heuristic and does not establish trust. Do not execute an attachment to determine what it contains.