Open In App

file command in Linux with examples

file command is used to determine the type of a file. .file type may be of human-readable(e.g. ‘ASCII text’) or MIME type(e.g. ‘text/plain; charset=us-ascii’). This command tests each argument in an attempt to categorize it.

It has three sets of tests as follows:



Syntax:

file [option] [filename]

Example: Command displays the file type



file email.py
file name.jpeg
file Invoice.pdf
file exam.ods
file videosong.mp4

Options:

Article Tags :