Useful Snippets


This blog is used to collect useful snippets related to Linux, PHP, MySQL and more. Feel free to post comments with improvements or questions!

Are your smart devices spying on you? Make better purchasing choices and find products that respect your privacy at

RSS Latest posts from my personal blog

Most viewed posts

Subscribe to RSS feed

Recognize the format of any file using the file command!

Stanislav KhromovStanislav Khromov

The file command provides you useful information about any file.

For example, here is the output for a text file:

file license.txt
license.txt: ASCII English text, with CRLF line terminators

And here is one for a binary file. (The whoami util.)

file /usr/bin/whoami
/usr/bin/whoami: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

Lots of good information regarding the CPU architecture (Intel i386)

And here is the output using an image file:

file zenhub.png
zenhub.png: PNG image data, 900 x 699, 8-bit/color RGB, non-interlaced

file is truly a great utility and I can see myself using it quite a bit in the future. :)

Web Developer at Aftonbladet (Schibsted Media Group)
Any opinions on this blog are my own and do not reflect the views of my employer.
Twitter Profile
Visit my other blog

Comments 0
There are currently no comments.