Concatenate multiple files and print to standard output.
cat [OPTION]... [FILE]...
-
.FILE (optional): The file to be processed, which can be one or more.
Long options are equivalent to short options
-A, --show-all Equivalent to the "-vET" combination option.
-b, --number-nonblank Only number non-blank lines, starting from 1, overriding the "-n" option.
-e is equivalent to the "-vE" combination option.
-E, --show-ends Display '$' characters at the end of each line.
-n, --number Number all lines, starting from 1.
-s, --squeeze-blank Squeeze consecutive blank lines into one line.
-t is equivalent to the "-vT" combination option.
-T, --show-tabs Use "^I" for TAB (tab character).
-u POSIX compatibility option, meaningless.
-v, --show-nonprinting Use "^" and "M-" symbols to display control characters, except LFD (line feed, that is, newline character '\n') and TAB (tab character).
--help Display help information and exit.
--version Display version information and exit.
The return status is success unless illegal options or illegal parameters are given.
# Combine and display multiple files
cat ./1.log ./2.log ./3.log
# Display non-printing characters, tabs, and newlines in the file
cat -A test.log
# Blank lines in compressed files
cat -s test.log
# Display the file and append line numbers to the beginning of all lines
cat -n test.log
# Display the file and append line numbers to the beginning of all non-blank lines
cat -b test.log
# Display the contents of standard input and the contents of the file together
echo '######' |cat - test.log
GNU coreutils
package. For related help information, please view man -s 1 cat
or info coreutils 'cat invocation'
.cat
command to view larger files, the text flashes across the screen quickly (scrolls), and the user often cannot see the displayed content clearly. To control the scrolling, press Ctrl+ Press the s
key to stop scrolling; press the Ctrl+q
key to resume scrolling; press the Ctrl+c
(interrupt) key to terminate the execution of the command and return to the Shell prompt state.less
, more
commands or text editors such as emacs
and vi
when viewing larger files.