Name
cat
Synopsis
cat [options] [files]
Read (concatenate) one or more files and print them on standard output. Read standard input if no files are specified or if - is specified as one of the files; input ends with EOF. You can use the > operator to combine several files into a new file, or >> to append files to an existing file. When appending to an existing file, use Ctrl-D, the end-of-file symbol, to end the session.
Options
- -A, --show-all
Same as -vET.
- -b, --number-nonblank
Number all nonblank output lines, starting with 1.
- -e
Same as -vE.
- -E, --show-ends
Print $ at the end of each line.
- -n, --number
Number all output lines, starting with 1.
- -s, --squeeze-blank
Squeeze down multiple blank lines to one blank line.
- -t
Same as -vT.
- -T, --show-tabs
Print TAB characters as ^I.
- -u
Ignored; kept for Unix compatibility.
- -v, --show-nonprinting
Display control and nonprinting characters, with the exception of LINEFEED and TAB.
Examples
cat ch1Display a filecat ch1 ch2 ch3 > allCombine filescat note5 >> notesAppend to a filecat > temp1Create file at terminal. To exit, enter EOF Ctrl-D).cat > temp2 << STOPCreate file at terminal. To exit, enter STOP.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access