What Is Cat Command in Unix with Examples?
Contents
Command Explanation
cat file1.txt file2.txt file3.txt | sort > test4 Concatenate the files, sort the complete set of lines, and write the output to a newly created file
cat file1.txt file2.txt | less Run the program “less” with the concatenation of file1 and file2 as its input

What is use of cat command in Unix?

The cat (short for “concatenate“) command is one of the most frequently used command in Linux/Unix like operating systems. cat command allows us to create single or multiple files, view contain of file, concatenate files and redirect output in terminal or files.

What is cat command Linux?

If you have worked in Linux, you surely have seen a code snippet that uses the cat command. Cat is short for concatenate. This command displays the contents of one or more files without having to open the file for editing. In this article, learn how to use the cat command in Linux.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest