depend memory chunky crown follow smoggy governor steep insurance childlike This post was mass deleted and anonymized with Redact Answer from AnApexBread on reddit.com
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › cat-command-in-linux-with-examples
Cat Command in Linux - GeeksforGeeks
September 14, 2017 - Linux-Unix · Interview Questions ... 9 Jan, 2026 · The cat (concatenate) command in Linux is used to view, create, and combine file contents directly from the terminal....
🌐
LinkedIn
linkedin.com › pulse › getting-started-kali-linux-iqra-akhtar
Getting Started with Kali Linux
April 2, 2023 - The ls command is a basic command that is commonly used in the command line interface (CLI) to navigate and explore the file system. ... The cat command in Kali Linux is used to display the contents of a file in the command line interface (CLI).
🌐
Linuxmoz
linuxmoz.com › linux-commands › cat
Cat Linux Commands - LinuxMoz
All you need to know about the Linux Cat Command, including examples, instructions, command options and install instructions.
🌐
YouTube
youtube.com › watch
cat Command in Kali Linux | Ultimate Beginner’s Guide to File Viewing and Concatenation - YouTube
🔥 Welcome to Zit X, your ultimate guide for Kali Linux! 🔥 In this video, we’re diving into the essential cat command in Kali Linux. 🖥️🐱 This versatile co...
Published   June 8, 2024
🌐
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.
Find elsewhere
🌐
LinuxConfig
linuxconfig.org › home › cat command in linux with examples
Cat command in Linux with examples
August 12, 2021 - This included frequently used options as well as advanced usage. cat is an essential command to master on Linux because it allows us to view all kinds of text files, but it’s also one of the simplest commands you’ll come across.
🌐
Linuxize
linuxize.com › home › linux commands › how to use the cat command in linux
How to Use the cat Command in Linux | Linuxize
October 10, 2018 - The most basic and common usage of the cat command is to read the contents of files. For example, the following command will display the contents of the /etc/issue file on the terminal: ... Instead of displaying the output to stdout (on the ...
🌐
Javatpoint
javatpoint.com › linux-cat
Cat Command in Linux/Unix with Examples - javatpoint
Parrot OS vs. Kali Linux ... Ubuntu Server vs. Desktop ... Arch Linux vs. Ubuntu ... Pop OS vs. Ubuntu ... command command is used to display the last ten lines of one or more files. Its main purpose is to read the error message. By default, it displays the last ten lines of a file.
🌐
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
🌐
HowtoForge
howtoforge.com › home › 10 linux cat command examples for beginners
10 Linux cat Command Examples for Beginners
So, when the same command was run with the -A command line option, tabs got replaced by ^I, and non-printing characters were displayed in a special notation. And finally, each line ended with a $. So, effectively, -A did what -vET would have done. We've covered most cat command options here, so practicing them should give you a pretty good idea about the tool. Do try them out, and once done, head over to the command's man page to learn more about them. ... Himanshu Arora has been working on Linux since 2007.
🌐
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.
🌐
Getcertifiedgetahead
getcertifiedgetahead.com › using-cat-and-grep
Using cat and grep — Get Certified Get Ahead
However, the auth.log will log all user authentication events in the log. Because any command entered with the sudo command is authenticated, you will also see your commands. Sep 19 18:52:02 localhost lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:1 ruser= rhost= user=kali · Sep 19 18:59:43 localhost sudo: kali : TTY=pts/0 ; PWD=/home/kali ; USER=root ; COMMAND=/usr/bin/cat /var/log/auth.log
🌐
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 - From the documentation, we can see that if no value is passed for the FILE argument, the cat command will read from standard input. Similarly, it will behave the same when a dash “-” value is passed for the FILE argument. In combination with the Linux redirection operators, we can make the cat command listen to the standard input stream and redirect the content to a file.
🌐
Linux Hint
linuxhint.com › cat-command-linux
Linux Cat Command Examples – Linux Hint
This command first creates the testfile_backup file and then copies the contents of testfile1 to it. Instead of overwriting the output of a targeted file in the pervious example, you can also make the cat command to append the output:
🌐
Computer Hope
computerhope.com › unix › ucat.htm
Linux Cat Command
...you could use the echo command to output text, pipe that output to cat, and instruct cat to catenate it with the file's contents, like this: ... In short, cat is a simple but very useful tool for working with the data in text files, system logs, configuration files, and any other human-readable data stored in a file. ... These options are available on GNU cat, which is standard on most Linux distributions.