Print or concatenate files
low risk
Concatenates files to standard output. Also used to create small files with redirection.
| Flag | Meaning |
|---|---|
-n | Number all lines |
-A | Show non-printing characters, tabs and line ends |
-s | Squeeze repeated blank lines |
cat /etc/os-releaseShow a file · explain & risk-check →cat a.txt b.txt > all.txtConcatenate into a new file · explain & risk-check →Useless use of cat: prefer `grep pattern file` over `cat file | grep pattern`.
Reference text is hand-written and may be incomplete — check man cat for your version. Test destructive commands on a non-production system first.