
He is interested in people, music, food and writing. You can edit it here and send me a pull request. Have an update or suggestion for this article? file -z īar.txt.gz: ASCII text (gzip compressed data, was "bar.txt", last modified: Wed Sep 7 19:31:23 2016, from Unix) In the following example a file is a gzip compressed ASCII text file. To view compressed files without decompressing them pass the -z option.
#BASH FIND FILE HOW TO#
How to view compressed files without decompressing This can be combined with the -b option to just show the mime type. To view the mime type of a file rather than the human readable format pass the -i option. Unix-file.md: ASCII text, with very long lines Unix-comm.md: ASCII text, with very long lines Unix-cat.md: ASCII text, with very long lines The file command can also operate on multiple files and will output a separate line to standard output for each file. How to determine the file type of multiple files Somefile.csv: Zip archive data, at least v2.0 to extract This can be verified by the file command. So a file called somefile.csv could actually be a zip file. The file command can be useful as filenames in UNIX bear no relation to their file type. To show just the file type pass the -b option. To determine the file type of a file pass the name of a file to the file command.The file name along with the file type will be printed to standard output. As filenames in UNIX can be entirely independent of file type file can be a useful command to determine how to view or work with a file. It reports the file type in human readable format (e.g. The file command determines the file type of a file. How to view compressed files without decompressing.How to determine the file type of multiple files.How to determine the file type of a file.Examples of a single file, multiple files, viewing mime types and compressed files.Įstimated reading time: 2 minutes Table of contents Last updated Saturday, Linux and Unix file command tutorial with examples Tutorial on using file, a UNIX and Linux command for determining file types.


Linux and Unix file command tutorial with examples | George Ornbo
