cat command

3.1 'cat': Concatenate and write files
======================================

'cat' copies each FILE ('-' means standard input), or standard input if
none are given, to standard output. Synopsis:

cat [OPTION] [FILE]...

The program accepts the following options. Also see *Note Common
options::.

'-A'
'--show-all'
Equivalent to '-vET'.

'-b'
'--number-nonblank'
Number all nonblank output lines, starting with 1.

'-e'
Equivalent to '-vE'.

'-E'
'--show-ends'
Display a '$' after the end of each line.

'-n'
'--number'
Number all output lines, starting with 1.

'-s'
'--squeeze-blank'
Replace multiple adjacent blank lines with a single blank line.

'-t'
Equivalent to '-vT'.

'-T'
'--show-tabs'
Display TAB characters as '^I'.

'-u'
Ignored; for POSIX compatibility.

'-v'
'--show-nonprinting'
Display control characters except for LFD and TAB using '^'
notation and precede characters that have the high bit set with
'M-'.


On systems like MS-DOS that distinguish between text and binary
files, 'cat' normally reads and writes in binary mode. However, 'cat'
reads in text mode if one of the options '-bensAE' is used or if 'cat'
is reading from standard input and standard input is a terminal.
Similarly, 'cat' writes in text mode if one of the options '-bensAE' is
used or if standard output is a terminal.

An exit status of zero indicates success, and a nonzero value
indicates failure.

Examples:

# Output f's contents, then standard input, then g's contents.
cat f - g

# Copy standard input to standard output.
cat

No comments:

Post a Comment