Viewing Content

cat

Prints and concatenates file contents.

cat writes file contents to standard output. It is good for short files and combining streams, not for paging through huge logs.

Syntax
cat [options] file...

Arguments explained

  • file is one or more files to print.
  • -n numbers output lines.

Common examples

Print a short config
cat /etc/os-release

Shows distribution identity information.

Combine files
cat part1.txt part2.txt > combined.txt

Writes both files into a new file.

cat Command
FieldDetails
Commandcat
CategoryViewing Content
Primary usePrints and concatenates file contents.
Syntaxcat [options] file...