Linux commands
| Command: cat |
show contents of file http://www.opengroup.org/onlinepubs/9699919799/utilities/cat.html |
||||||||||||||||
|
Description of commmand / detailed explanation:
The However, the cat command lets you display the contents of a text file to standard output, more commonly known as your screen. The Cat command is often used in bash scripts to add or remove other data to the file in question. The Tac command (Cat backwards) prints everything the other way round, from bottom to top, instead of from top to bottom. |
|||||||||||||||||
|
Command options:
*If the -v is used -e and -t will be ignored. |
|||||||||||||||||
How to use it: cat [-u] [file...] |
|||||||||||||||||
|
Typical Usage Examples:
cat file1.txt file2.txt > file3.txt - Reads file1.txt and file2.txt and combines those files to make file3.txt.
cat file1 file2 file3 > file4 - Creates a file from concatenating file1, file2, and file3. cat -T myfile.txt - The T option shows TAB characters. cat -v myfile.txt - The -v option shows all non-printing characters, except for line feed and tab cat -Tv myfile.txt - You can combine the 2 options too Useless use of catUUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As received wisdom on comp.unix.shell observes, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.” Nevertheless one sees people doing cat file | some_command and its args ..... instead of the equivalent and cheaper <file some_command and its args ... or (equivalently and more classically) some_command and its args ... <file |
|||||||||||||||||
|
Available in: debian
fedora gentoo suse mandriva ubuntu |
Related commands:
|
||||||||||||||||