cat

Concatenate files and print on the standard output. Often used just to display the content of a short file.

Synopsis

cat [options] [file]

Core Options

-n

Number all output lines.

-b

Number nonempty output lines.

-E

Display $ at end of each line.

Usage Examples

Display File Content

Print the contents of a file to the terminal.

cat README.md

Concatenate Files

Combine two files into a new one.

cat part1.txt part2.txt > combined.txt

Show Line Numbers

Display contents with line numbering.

cat -n code.py

Create a File (Quickly)

Type content into a file. Press Ctrl+D to save and exit.

cat > newfile.txt
Built for builders.