What Linux command line tool is used for printing the contents of files to the console?
cat
The cat
command in Linux is a utility that concatenates and displays file contents. It is frequently used for creating, viewing, or joining text files, serving as a fundamental tool for text manipulation in the Linux command line.
For example to print a file named sup.txt
you would use: cat sup.txt
. If you needed to print several files you can do that by passing them in with spaces: cat file1.txt file2.txt file3.txt
, etc.
cat is a standard Unix utility that reads files sequentially, writing them to standard output. The name is derived from its function to (con)catenate files (from Latin catenare, "to chain"). It has been ported to a number of operating systems. The other primary purpose of cat, aside from concatenation, is file printing — allowing the computer user to view the contents of a file. Printing is the most common use of cat.
Cat_(Unix) - Wikipedia, the free encyclopediaJoin premium for unlimited access and more features