Get file type and its metadata from command line


There is a way to find file type, and related metadata to the file from command line.

Meta data includes some details like Operating system, file type, Created time, Last saved time etc.. and many others depending on file type.

The command you need to use to get file type is file.


$ file Linux_shell_scripting_v2.pdf

Output: Linux_shell_scripting_v2.pdf: PDF document, version 1.3


Output: ASCII text, with very long lines



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s