The file utility is a command-line tool that attempts to classify each given file according to its contents. It performs several tests to determine the file type, including filesystem tests, magic number tests, and language tests.
file: The main command-line utility for file type detectionlibmagic.so: Contains routines for magic number recognition used by the file program and other applications# Determine file type
file document.pdf
# Get MIME type
file -i image.jpg
# Show brief description
file -b script.sh
# Check multiple files
file *.txt
This package is distributed under the BSD 2-Clause License.