The cat command
Print the contents of files. Prints each file, one after the other (cat is short for concatenate). With no file, it reads what is piped into it. To see only the start or the end of a long file, use head or tail.
Usage
cat [OPTION]... [FILE]...
Options
| -n, --number | number every line |
|---|
Examples
cat notes.txtShow a filecat -n notes.txtShow it with line numberscat part1.txt part2.txt > whole.txtJoin two files into a third
Learn it step by step
Related commands
learner@sandbox: ~bash (practice)
Note: Try cat here: your home directory has sample files. Press Try beside an example, or type your own.
Enter runs · Tab completes names · ↑ ↓ step through history · Ctrl+L clears · type help for every command
A practice shell in your browser that behaves like bash on Linux for these commands. Nothing you type leaves the page.