-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux file Guide
Mattscreative edited this page Dec 5, 2025
·
3 revisions
Complete beginner-friendly guide to file on Linux, covering Arch Linux, CachyOS, and other distributions including file type detection, MIME type identification, and file classification.
Basic usage:
# Detect file type
file file.txt
# Output: file.txt: ASCII textIdentify unknown:
# Identify unknown file
file unknown.bin
# Attempts to identify file typeText detection:
# Text file
file document.txt
# Output: ASCII textBinary detection:
# Binary file
file program.bin
# Output: ELF 64-bit LSB executableMIME type:
# MIME type
file --mime-type file.txt
# Output: text/plainMIME encoding:
# MIME encoding
file --mime-encoding file.txt
# Output: us-asciiMultiple detection:
# Multiple files
file file1.txt file2.bin
# Shows type for each fileDirectory scan:
# Recursive scan
file -r directory/
# -r = recursive (scans directory)Check installation:
# file is usually pre-installed
# Install if missing
sudo pacman -S fileThis guide covered file usage, file type detection, and MIME type identification for Arch Linux, CachyOS, and other distributions.
- stat Guide - File statistics
- ls Guide - List files
- File Operations - File management
-
file Documentation:
man file
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.