View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > File (command)

From LQWiki

Jump to: navigation, search

file is a command used to provide an overview of one or more files and identify the contents.

Running cat on a binary can do disconcerting things to your terminal1 and trying to untar a zipfile is an exercise in frustration. file is the answer to these problems and more. If you try to untar a file and tar reports back cryptic failures, file will identify what the file actually is and from that you can decide the proper tool to use.

Also, while it is customary to name shell scripts with a '.sh' extension, it's more economical not to and distro scripts are rarely named that way. 'file' provides a quick overview of what's a script and what's a binary when 'ls' merely displays a bunch of executables.


Personal tools