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.

Answer from muru on askubuntu.com
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › cat-command-in-linux-with-examples
Cat Command in Linux - GeeksforGeeks
January 9, 2026 - The cat (concatenate) command in Linux is used to view, create, and combine file contents directly from the terminal.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › linux cat command (with examples)
Linux cat Command (With Examples) | phoenixNAP KB
September 4, 2025 - The file contents print in reverse order, starting from the last line. Use the cat command with >> to append file contents to the end of another file. For example: ... The command has no output.
Discussions

Linux Terminal Cat Command
cat file1 file2 > concatenated.txt https://www.gnu.org/software/bash/manual/html_node/Redirections.html#Redirecting-Output More on reddit.com
🌐 r/linuxquestions
5
7
March 26, 2023
Does anyone know what the "cat" process does?
From the terminal, it's short for concatenate, which is a command that basically joins two or more files into one single file. Why it's running in the background I'm not exactly sure, have they been running long? It might be getting called for some scheduled process but I'm not sure. More on reddit.com
🌐 r/linuxquestions
27
11
January 29, 2022
Linux cat command explained with basic practical examples
Welcome to /r/Linux! This is a community for sharing news about Linux, interesting developments and press. If you're looking for tech support, /r/Linux4Noobs and /r/linuxquestions are friendly communities that can help you. More on reddit.com
🌐 r/linux
9
4
July 27, 2014
bat > cat

If you like this then you may also enjoy:

  • ripgrep (grep)

  • exa (ls)

  • fd (find)

  • jq (json awk/sed like tool)

  • fzf (fuzzy finder)

  • watchexec (watches dir for changes and runs a command)

  • ion (shell)

  • runiq (uniq)

More on reddit.com
🌐 r/linux
34
56
October 25, 2016
People also ask

How to append the content of one file to another using the Cat Command?
To append the content of one file to another using the Cat Command, use the command "cat file1 &gt;&gt; file2", where "file1" is the source file and "file2" is the destination file.
🌐
theknowledgeacademy.com
theknowledgeacademy.com › blog › cat-command-in-linux
Cat Command in Linux: What is it and How to Use it?
Can the lines be numbered while displaying the content with "cat"?
Yes, lines can be numbered while displaying the content with Cat Command using the "-n" option. Simply use the command "cat -n filename" to display the content of the file with line numbers.
🌐
theknowledgeacademy.com
theknowledgeacademy.com › blog › cat-command-in-linux
Cat Command in Linux: What is it and How to Use it?
What is the Knowledge Pass, and how does it work?
The Knowledge Academy’s Knowledge Pass, a prepaid voucher, adds another layer of flexibility, allowing course bookings over a 12-month period. Join us on a journey where education knows no bounds.
🌐
theknowledgeacademy.com
theknowledgeacademy.com › blog › cat-command-in-linux
Cat Command in Linux: What is it and How to Use it?
🌐
Server Academy
serveracademy.com › blog › the-linux-cat-command
The Linux cat Command - Server Academy
Introduction to the cat Command 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.
🌐
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 in Linux and open source solutions.
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
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › cat-command-in-linux
Cat Command in Linux: What is it and How to Use it?
November 15, 2025 - When used, the Cat Command concatenates and outputs the contents of one or multiple files to the standard output, which is typically the terminal. In Linux, the Cat Command is an essential tool for managing text files, enabling users to efficiently ...
Find elsewhere
🌐
Wikipedia
en.wikipedia.org › wiki › Cat_(Unix)
cat (Unix) - Wikipedia
1 month ago - 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. cat was part of the early versions of Unix, e.g., Version 1. ...
🌐
Hostinger
hostinger.com › home › tutorials › how to use the linux cat command
How to Use the Linux cat Command With Examples
February 24, 2025 - This command concatenates multiple files into a single file. It functions exactly like the redirection feature above but with multiple source files. It is useful when merging log files and combining configuration files.
🌐
Linux Man Pages
man7.org › linux › man-pages › man1 › cat.1.html
cat(1) - Linux manual page
CAT(1) User Commands CAT(1) cat - concatenate files and print on the standard output · cat [OPTION]... [FILE]... Concatenate FILE(s) to standard output. With no FILE, or when FILE is -, read standard input.
🌐
TecMint
tecmint.com › home › linux commands › how to use the cat command in linux [22 useful examples]
22 Essential Cat Command Examples for Linux Users
July 14, 2023 - Ravi SaiveLast Updated: July 14, ... pre-installed in most Linux distribution systems and is primarily used to display the content of existing files....
🌐
Linode
linode.com › docs › guides › linux-cat-command
The Linux cat Command | Linode Docs
June 16, 2022 - The cat command can take a filename as input, and it outputs the file’s text contents as a result. ... This is text is an example file. For long files, the output can be difficult to navigate. Fortunately, there is a built-in solution with Linux that is covered in this guide.
🌐
Red Hat
redhat.com › en › blog › linux-bat-command
Drop the Linux cat command for bat
November 21, 2025 - The cat command on Linux concatenates files together. It's often used to concatenate one file to nothing to print the single file's contents to the terminal....
🌐
Hostman
hostman.com › tutorials › how to use the linux cat command: tutorial and examples
How to Use the Linux Cat Command | Hostman
December 26, 2025 - The basic purpose of the cat command is to join files together and show their contents on the terminal. Its usefulness goes far beyond simple concatenation, though. With its many functions, it's a useful addition to any Linux user's command-line ...
Price   $
Address   1999 Harrison St 1800 9079, 94612, Oakland
🌐
IBM
ibm.com › docs › ssw_aix_71 › com.ibm.aix.cmds1 › cat.htm
cat Command
We cannot provide a description for this page right now
🌐
freeCodeCamp
freecodecamp.org › news › the-cat-command-in-linux-how-to-create-a-text-file-with-cat-or-touch
The Cat Command in Linux – How to Create a Text File with Cat or Touch
June 11, 2020 - The most common use of the cat command is to output the contents of a file. The following is an example that you can try. echo "Dance, Dance" > cat_create #create a file cat cat_create · In this simple example, we're using a combination of echo and a redirect to create a file containing "Dance, Dance".
🌐
Baeldung
baeldung.com › home › scripting › writing text to file using linux cat command
Writing Text to File Using Linux Cat Command | Baeldung on Linux
August 27, 2025 - The cat command is a utility command in Linux. One of its most common usages is to print the content of a file onto the standard output stream.
🌐
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.
🌐
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.