Linux

cat

SafePrint file contents

cat <file>

Prints file contents; can concatenate and number lines (-n).

Examples

  • cat -n /etc/hostsShow with line numbers
  • cat a.txt b.txt > all.txtConcatenate into one file

Syntax

cat <file> [file2 ...]

Before you run it

Read-only.

Related commands

  • lessView with pager
  • headShow top lines
  • tailFollow file tail
  • typePrint file contents

The same reference, with no signal at all

Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store