Title: cat Command
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review > Section: Learning Modules

The cat command is one of the most universal tools. All it does is copy standard input to standard output. In combination with the shell, this can be very powerful and diverse. Some examples will give a glimpse into the possibilities. The first example is simple. You can use cat to display a file on the screen. If the file is longer than the screen, it will scroll to the end. (Paul Cobbault, p. 46)

- By itself it echoes text.
- Followed by a file, it displays the file.
- Followed by '>' and a file name, it overwrites the file.
- Followed by '>>' and a file name, it appends data to the file.
- Followed by '<' and a file name, it displays the file content.
- cat < file1 > file 2 will overwrite file2 with the contents of file1.