home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: cancel Chapter 2
UNIX Commands
Next: Reference: cb
 

cat



cat

 [

options

] [

files

]

Read 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; end input with EOF . You can use the > operator to combine several files into a new file; use >> to append files to an existing file.

Options

-e

Print a $ to mark the end of each line. Must be used with -v .

-s

Suppress messages about nonexistent files. (Note: In the BSD version, -s squeezes out extra blank lines.)

-t

Print each tab as ^I and each form feed as ^L. Must be used with -v .

-u

Print output as unbuffered (default is buffered in blocks or screen lines).

-v

Display control characters and other nonprinting characters.

Examples



cat ch1

		
Display a file.



cat ch1 ch2 ch3 > all

		
Combine files.



cat note5 >> notes

		
Append to a file.



cat > temp1

		
Create file at terminal; end with EOF.



cat > temp2 << STOP

		
Create file at terminal; end with 

STOP
.


Previous: Reference: cancel UNIX in a Nutshell: System V Edition Next: Reference: cb
Reference: cancel Book Index Reference: cb

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System










??????????????@Mail.ru