cat
Quick Reference
Command Name:
cat
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
File viewing
Display contents of text files in the terminal
- 2
File concatenation
Combine multiple files into a single output
- 3
Data inspection
Quickly inspect file contents without editing
- 4
Script input
Provide file contents as input to other commands
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:
cat filename.txt
cat file1.txt file2.txt
cat -n filename.txt