file
FilesBeginner In simulator In real LinuxDetermine a file type
Name: file: determine file type
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
file determines a file's type by looking at its content (its "magic" bytes) rather than its extension. It recognises executables, scripts, images, archives, text encodings and much more.
That matters on Linux, where extensions are only a convention and may be missing or wrong.
Syntax
file [OPTION]... FILE...Common options
| -b / --brief | Don't prefix with the file name |
| -i / --mime | Print the MIME type |
| -L / --dereference | Look at what symbolic links point to |
| -z / --uncompress | Look inside compressed files |
| -s / --special-files | Read device files too (to see the file system on /dev/sda1) |
| -f / --files-from FILE | Read the names to check from FILE, one per line |