next up previous contents
Next: grep Up: Essential administration tools Previous: vi

cat

It concatenates files and prints on the standard output.

e.g.

Merge all files in /var/log with filenames starting with message into a single file ~/all_message_log.

cat /var/log/message* > ~/all_message_log

The command cat is particularly useful when you have no access to any text editor, even vi.

e.g.

When you want to add few lines to an existing files ~/cat/book, you can:

cat >> ~/cat/book

Type what you want to be appended to ~/cat/book and type Ctrl-D (pressing <Ctrl> key and "D" key simultaneously). Show the new ~/cat/book by cat ~/cat/book and check the additional lines at the end of the file.



System Administrator
Thu Jul 26 10:50:59 HKT 2001