Command library / cat
cat
Print a file's contents to the screen
Reads a file (or several, concatenated) and writes it straight to standard output — the fastest way to see what's inside a small file. -n numbers every line, useful when someone points you at 'line 42'.
Practice catUsage
cat [-n] file...
Options and flags
fileone or more files to print, in order
-n, --numbernumber every output line
Examples
cat /etc/hostnamePrint this machine's hostname file.
cat access.log error.logPrint both files, one after the other.
cat -n app.confPrint with line numbers — handy for referring back to a specific line.
Common mistakes
cat cat /etc/hostname
cat always needs at least one file to read — without one it just waits, reading from your keyboard instead.