๐ŸŒ
Linux Man Pages
man7.org โ€บ linux โ€บ man-pages โ€บ man1 โ€บ cat.1.html
cat(1) - Linux manual page
-A, --show-all equivalent to -vET ... notation, except for LFD and TAB --help display this help and exit --version output version information and exit ยท cat f - g Output f's contents, then standard input, then g's contents....
Unix utility that concatenates and lists files
Cat-example-command.gif
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 โ€ฆ Wikipedia
Factsheet
cat
Original authors Ken Thompson,
Dennis Ritchie
Factsheet
cat
Original authors Ken Thompson,
Dennis Ritchie
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Cat_(Unix)
cat (Unix) - Wikipedia
1 month ago - 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 ...
๐ŸŒ
nixCraft
cyberciti.biz โ€บ nixcraft โ€บ howto โ€บ linux โ€บ cat command in linux / unix with examples
cat Command in Linux / Unix with examples - nixCraft
December 2, 2025 - See cat command man page by typing the man command: $ man cat $ cat --help ยท ๐Ÿฅบ Was this helpful? Please add a comment to show your appreciation or feedback. Vivek Gite is an expert IT Consultant with over 25 years of experience, specializing ...
๐ŸŒ
Linux Command Library
linuxcommandlibrary.com โ€บ man โ€บ cat
cat man | Linux Command Library
cat (concatenate) reads files sequentially and writes their contents to standard output. It is one of the most frequently used Unix utilities, serving as the standard way to display file contents, combine multiple files, and pipe data to other ...
๐ŸŒ
Linux Man Pages
linux.die.net โ€บ man โ€บ 1 โ€บ cat
cat(1): concatenate files/print on stdout - Linux man page
cat - concatenate files and print on the standard output ... Concatenate FILE(s), or standard input, to standard output.
๐ŸŒ
SS64
ss64.com โ€บ bash โ€บ cat.html
cat Man Page - Linux - SS64.com
Concatenate FILE(s), or standard input, to standard output. Syntax cat [Options] [File]... Options -A, --show-all equivalent to -vET -b, --number-nonblank number nonblank output lines -e equivalent to -vE -E, --show-ends display $ at end of each line -n, --number number all output lines -s, ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ linux-unix โ€บ cat-command-in-linux-with-examples
Cat Command in Linux - GeeksforGeeks
September 14, 2017 - The cat (concatenate) command in Linux is used to view, create, and combine file contents directly from the terminal.
Top answer
1 of 4
17

cat's primary purpose is to concatenate files. cat file1 file2 ... will show the contents of file, file2 and the others one after the other, as if the contents were in a single file. See the manpage:

NAME
       cat - concatenate and print files

It is meant for usage where either:

  • a target command cannot read from files and you need to pass multiple files to it. An example is the tr utility. Ordinarily, with one file, you'd do:

    tr < file
    

    But with multiple files, redirection can't be used, so you have to do:

    cat file1 file2 ... | tr
    
  • a target command can read from multiple files, but its behaviour may change when it's given multiple files. An example is wc, which prints the counts for each file, along with the filenames, where you might have wanted just the total, without a filename.

Remember that most commands you encounter (grep, sed, awk, sort, ...) can read files perfectly fine.

If you want to view the contents of a file, use a pager - less and more are both eminently capable of presenting files for viewing, and are far more convenient to use.

2 of 4
14

cat is one of the most frequently used commands on Unix-like operating systems. It has three related functions with regard to text files:

  1. displaying them
  2. combining copies of them
  3. creating new ones.
  4. Copy files

cat's general syntax is:

cat [options] [filenames] [-] [filenames]

Reading Files

The most common use of cat is to read the contents of files, and cat is often the most convenient program for this purpose. All that is necessary to open a text file for viewing on the display monitor is to type the word cat followed by a space and the name of the file and then press the ENTER key. For example, the following will display the contents of a file named file1:

cat file1

Concatenation

The second role of cat is concatenation. (This is the source of cat's curious name.) There is no effect on the original files.

For example, the following command will concatenate copies of the contents of the three files file1, file2 and file3:

cat file1 file2 file3

The contents of each file will be displayed on the monitor screen. This output could just as easily be redirected using the output redirection operator to another file, such as file4, using the following:

cat file1 file2 file3 > file4

File Creation

Thanks to @muru comment : cat is capable of create new files depending on the shell redirection feature and not itself

For small files this is often easier than using vi, gedit or other text editors. It is accomplished by typing cat followed by the output redirection operator and the name of the file to be created, then pressing ENTER and finally simultaneously pressing the Ctrl & d keys.

For example, a new file named file1 can be created by typing

cat > file1

then press ENTER and simultaneously press the Ctrl & d keys.

PS1: If a file named file1 already exists, it will be overwritten

PS2: you can append to exited file using append operator >> example cat >> file1

Copy Files

The cat command can also be used (depending on shell redirection feature) to create a new file and transfer to it the data from an existing file. Example: make a copy of file oldfile.txt:

cat oldfile.txt > newfile.txt

References:

  • Linux and Unix cat command
  • The cat Command
  • cat (Unix)
  • HowTo: Use cat Command In Linux / UNIX
Find elsewhere
๐ŸŒ
Hostinger
hostinger.com โ€บ home โ€บ tutorials โ€บ how to use the linux cat command
How to Use the Linux cat Command With Examples
February 24, 2025 - Practice using the cat command ... basic Linux commands. The cat command in Linux is primarily used to display file contents, concatenate files, and create new files....
๐ŸŒ
CommandLinux
commandlinux.com โ€บ man-page โ€บ man1 โ€บ cat.1.html
cat linux command man page
Section: User Commands (1) Updated: March 2015 Index Return to Main Contents ยท cat - concatenate files and print on the standard output ยท cat [OPTION]... [FILE]... Concatenate FILE(s), or standard input, to standard output. -A, --show-all ยท equivalent to -vET ยท
๐ŸŒ
Linux Man Pages
man7.org โ€บ linux โ€บ man-pages โ€บ man1 โ€บ cat.1p.html
cat(1p) - Linux manual page
The following command: cat doc1 doc2 > doc.all concatenates the files doc1 and doc2 and writes the result to doc.all. Because of the shell language mechanism used to perform output redirection, a command such as this: cat doc doc.end > doc causes the original data in doc to be lost before cat even begins execution.
๐ŸŒ
Computer Hope
computerhope.com โ€บ unix โ€บ ucat.htm
Linux Cat Command
This page covers the GNU/Linux version of cat. ... cat stands for "catenate." It is one of the most commonly-used commands in Unix-like operating systems.
๐ŸŒ
Linuxguide
linuxguide.it โ€บ command_line โ€บ linux-manpage โ€บ do.php
Linux Man Page: cat command - Open Software
LinuxGuide.it is the official reference about Linux Command Line, more than 400 instructional approaches of linux commands, popular commands - use open software!
๐ŸŒ
Server Academy
serveracademy.com โ€บ blog โ€บ the-linux-cat-command
The Linux cat Command - Server Academy
The cat command in Linux is one of the most frequently used commands in Unix-like operating systems. It stands for โ€œconcatenateโ€ and is primarily used to read, display, and concatenate text files.
๐ŸŒ
The Knowledge Academy
theknowledgeacademy.com โ€บ blog โ€บ cat-command-in-linux
Cat Command in Linux: What is it and How to Use it?
The primary purpose of the Cat Command is to read and display the contents of files. By providing the file name as an argument to the Cat Command, users can easily view the entire content of a file in the terminal.
๐ŸŒ
Vultr
docs.vultr.com โ€บ how-to-use-the-cat-command-in-linux
How to Use the Cat Command in Linux: Complete Guide | Vultr Docs
May 21, 2025 - The cat command is a powerful and flexible utility in Linux. It allows you to view, concatenate, and manipulate file contents. The name cat stands for concatenate, reflecting its original purpose of merging files into a single output stream.
๐ŸŒ
Beebom
beebom.com โ€บ how-use-cat-command-linux-with-examples
How to Use cat Command in Linux (with Examples) | Beebom
October 15, 2025 - In the above example, when you execute the command as per the above syntax, the file does not get printed on the same terminal prompt, instead, it shows the file contents in a new terminal view as shown in the second picture. Here you can scroll through the text using the arrow keys. To get to the bottom of the text use โ€œGGโ€ and to get to the top of the text, use โ€œggโ€. To exit the new terminal view, press โ€œqโ€. The cat command, along with the tac command, greatly simplifies file management for users comfortable using the Linux Terminal.
๐ŸŒ
RoseHosting
rosehosting.com โ€บ home โ€บ 10 basic cat commands in linux with examples
10 basic cat commands in Linux with examples | RoseHosting
October 5, 2022 - Execute the command below: ... You will receive a huge list of definitions and options with examples. root@vps:~# man cat NAME cat - concatenate files and print on the standard output SYNOPSIS cat [OPTION]... [FILE]... DESCRIPTION Concatenate ...
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ home โ€บ unix_commands โ€บ cat command in unix
Cat Command in Unix
October 13, 2007 - Learn how to use the cat command in Unix to display, concatenate, and create text files efficiently. Explore examples and syntax.