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 and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store