Windows type equivalent in Linux
Shows the contents of a text file in the terminal. Also used to combine files.
type
cat
cat
cat
Overview
What this command does
On Windows, "type" is used to display file contents. On Linux, the closest practical mapping shown here is "cat". Shows the contents of a text file in the terminal. Also used to combine files. This reference is grouped under File Management → File System.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows type maps to cat for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
For the broader concept behind this mapping, read Linux filesystem for Windows users.
Practical tasks
Common use cases
Display file contents
Shows the contents of a text file in the terminal. Also used to combine files.
cat -n
Show line numbers
cat -A
Show special characters (tabs, line endings)
less file
Scroll through large files (better than cat)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
cat file.txt
cat -n file.txt
less bigfile.txt
head -n 10 file.txt
tail -f /var/log/syslog
Walkthrough
Examples with explanations
# Windows: type file.txt
cat file.txt # display file
cat -n file.txt # display with line numbers
# For large files, use 'less' instead:
less bigfile.txt # scroll with arrows, q to quit
head -n 10 file.txt # first 10 lines
tail -f /var/log/syslog # watch a log file in real-time
Reference
Common options and variations
| Command or option | Use |
|---|---|
cat -n | Show line numbers |
cat -A | Show special characters (tabs, line endings) |
less file | Scroll through large files (better than cat) |
head -n 20 | Show first 20 lines only |
tail -n 20 | Show last 20 lines only |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "cat" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | cat |
Same command on this distribution. |
| Fedora | same command | cat |
Same command on this distribution. |
| Arch | same command | cat |
Same command on this distribution. |
Keep learning