cat
file managementLinux/Unix
The cat command is one of the most frequently used commands in Linux/Unix-like operating systems. cat Concatenate and display files
Quick Reference
Command Name:
cat
Category:
file management
Platform:
Linux/Unix
Basic Usage:
cat filename.txt
Common Use Cases
Syntax
cat [OPTION]... [FILE]...
Options
Option | Description |
---|---|
-n |
Number all output lines |
-b |
Number non-empty output lines |
-A |
Show all non-printable characters |
-s |
Suppress repeated empty output lines |
-T |
Display tab characters as ^I |
-v |
Show non-printing characters using ^ and M- notation |
Examples
How to Use These Examples
The examples below show common ways to use the cat
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples
Display the contents of a file.cat filename.txt
cat file1.txt file2.txt
cat -n filename.txt