via Wikipedia infobox
The cat utility shall read files in sequence and shall write their contents to the standard output in the same sequence. Write bytes from the input file to the standard output without delay as each is read. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( The standard output shall contain the sequence of bytes read from the input files. Nothing else shall be written to the standard output. If the standard output is a regular file, and is the same file as any of the input file operands, the implementation may treat this as an error. The -u option has value in prototyping non-blocking reads from FIFOs. The intent is to support the following sequence: concatenates the files doc1 and doc2 and writes the result to doc.all . causes the original data in doc to be lost before cat even begins execution. This is true whether the cat command fails with an error or silently succeeds (the specification allows both behaviors). In order to append the contents of doc.end without losing the original contents of doc , this command should be used instead: because the entire contents of the file would be consumed by cat the first time '-' was used as a file operand and an end-of-file condition would be detected immediately when '-' was referenced the second time. The latter also has the advantage that its output is unambiguous, whereas the output of historical cat -etv is not. The -s option was omitted because it corresponds to different functions in BSD and System V-based systems. The BSD -s option to squeeze blank lines can be accomplished by the shell script shown in the following example: The System V -s option to silence error messages can be accomplished by redirecting the standard error. Note that the BSD documentation for cat uses the term "blank line" to mean the same as the POSIX "empty line'': a line consisting only of a . The BSD -n option was omitted because similar functionality can be obtained from the -n option of the pr utility.
~7 min read
cat is a shell command for writing the content of a file or input stream to standard output. The name is an abbreviation of catenate, a variant form of concatenate. Originally developed for Unix, it is available on many operating systems and shells today.
In addition to combining files, cat is commonly used to copy files and in particular to copy a file to the terminal monitor. Unless redirected, cat outputs file content on-screen.
Excerpt from a page describing this subject · 9,332 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).