> ## Content Index
> Fetch the complete content index at: https://mfitzp.ghost.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Get file type information from the command line
- URL: https://mfitzp.ghost.io/get-file-type-information-from-the-command-line/
- Published: 2011-11-29T00:00:00.000Z
- Updated: 2023-06-25T19:00:46.000Z
- Author: Martin Fitzpatrick
- Tags: Tutorials, #Import 2024-03-14 08:20, #Import 2026-08-24 14:26

Sometimes you're not sure what type of file a file is. Perhaps the file doesn't have an extension, or it's been removed accidentally. The often forgotten the `file` command will analyze a file for common markers and give you a simple summary of a file's type and content.

At the prompt enter the following, where `<filename>` is the name of the file you are interested in.

```bash
file <filename>
```

 You will receive output detailing the files contents, e.g.

> A Word Document.doc: Composite Document File V2 Document, Little Endian, Os: Windows, Version 6.1 Code page: -535, Title: A Word Document, Author: mxf793, Template: Normal, Last Saved By: mxf793, Revision Number: 4, Name of Creating Application: Microsoft Office Word, Total Editing Time: 07:00, Create Time/Date: Mon Feb 7 11:52:00 2011, Last Saved Time/Date: Mon Feb 7 11:56:00 2011, Number of Pages: 2, Number of Words: 271, Number of Characters: 1545, Security: 0