Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

ปุ่มแปลไทยจะเปิดบทความผ่าน Google Translate เพื่อแปลอัตโนมัติ โดยคงโค้ดและคำสั่งไว้ตามต้นฉบับ

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.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

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.

Source & further reading

Linux manual — file

Independently written summary reviewed on 2026-11-01. The example illustrates a possible application; it is not a client case study.

Share this article

Back to all articles