# file

*noun*

say it: **“FYL”** **/faɪl/**

A command that looks inside a file and reports what kind of data it holds, such as plain text, a picture or a program.

## What does the `file` command do?

`file` looks inside a file and says what kind it is: plain text, a picture, a program. It goes by what's inside, not by the name, so it's a safe check before you open a file with `cat`.

```bash
file README.md
# README.md: ASCII text
```

## In a sentence

- “Before opening the mystery download, Leo ran **file** on it and learned it was a picture, not text.”
- “The **file** command said README.md was ASCII text, so cat was safe to use.”

Level: Apprentice · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=2)

Updated: November 10, 2026

## In other subjects

- [File in C#](https://www.ask-codey.com/glossary/file-c-sharp)
- [File in Java](https://www.ask-codey.com/glossary/file)

Source: https://www.ask-codey.com/glossary/file-unix
