Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
10+ Basic Cat Command Examples in Linux [2023]

10+ Basic Cat Command Examples in Linux [2023]

Posted on March 18, 2022January 29, 2023 By admin

10+ Basic Cat Command Examples in Linux [2023]

cat command is used for various file management tasks like creating single or multiple files, viewing the content of a file, concatenating files, and redirecting output in terminal or files.

Let’s have a look at the Cat command syntax and the examples.

10+ Basic Cat Command Examples in Linux [2023]

Linux is all about playing with different commands for the job execution cat is most commonly used to display the contents of text files

Cat Command Syntax

cat [OPTIONS] [FILE_NAMES]

1. Displaying The  Contents of File with Cat command

One of the most common uses of the cat command is to display the content of the file. Run the following cat command to display the contents of /etc/issue file.

# cat /etc/issue

2.  Redirect The Contents of the file using cat command

Run the following command to redirect the content of the file from one file to another.

cat file1.txt > file2.txt

3. View Contents of Multiple Files in terminal

In below example, it will display the contents of the test and test1 file in the terminal.

# cat test test1

Hello everybody
Hi world,

4. Create a File with Cat Command

Run the following command to create a file called newfilecreated with the below command.

# cat >newfilecreated

It will ask input from the user, after providing input press CTRL+D (hold down Ctrl key and type ‘d‘) to exit. Now you can see the content in the “newfilecreated” with

# cat newfilecreated

Run the following command with more and less parameters when you have a file with large content.

# cat largefile.txt | more
# cat largefile.txt | less

Run the following cat command with the -n option

# cat -n file.txt

1  hi
2  my name is 
3  Akbar
4  Anthony

5. Display Multiple Files at Once

Run the following cat command to display the content of the multiple files at once.

# cat testfile; cat testfile1; cat testfile2

This is a testfile
This is the testfile1 file.
This is testfile2 file.

6. Redirecting Multiple Files Contain in a Single File

Run the following cat command to redirect multiple files in a newly created file called testfile3

# cat test testfile1 testfile2 > testfile3

Summary: This is the example of the cat command in Linux and its usage with the examples. Let us know if you have any queries about this article.

READ More Relevant Stuff:  Useful Best GNOME Desktop Extensions Updated
How To Ubuntu, Linux, Linux Commands

Post navigation

Previous Post: How To Fix No route to host SSH Error In Linux [Solved]
Next Post: LMDE 5 “Elsie” Is Now Available For Download

Related Posts

Free Online Linux Tutorials For Beginners In 2020 Free Online Linux Tutorials For Beginners In 2022 Linux
How To Mount A Removable Drive In WSL [Windows System Linux] How To Mount A Removable Drive In WSL [Windows System Linux] Linux
List Users In Linux Using Command Line List Users In Linux Using Command Line Linux
How To Clear Pip Cache On Linux How To Clear Pip Cache On Linux Linux
How To Install Java On RHEL 8: RedHat Tutorial How To Install Java On RHEL 8: RedHat Tutorial Linux
Install Squid Proxy on Ubuntu 20.04 Install Squid Proxy on Ubuntu 20.04 Linux

Recent Posts

  • New Job Search October 10, 2025
  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at info@itsubuntu.com
  • Epic Business Intelligence Reporting and Analytics Developer/Analyst a

    • Santa Clara, CA (Remote)
    • TriOptus LLC
    • Full Time
  • Remote Nonclinical Writer for Regulatory Submissions

    • Chicago, IL
    • MMS
    • Full Time
  • Grant Writer

    • Glendale, CA
    • Neighborhood Legal Services of Los Angeles County
    • Full Time
  • Grant Writer

    • Los Angeles, CA
    • Downtown Women's Center
    • Full Time
  • Customs Entry Writer

    • Houston, TX
    • FreightTAS
    • Full Time
  • Crisis & Incident Policy Writer (Autonomous Vehicles or Mobility & Transportation domain)

    • Mountain View, CA
    • US Tech Solutions
    • Full Time
  • Remote Health & Safety Writer for Construction

    • Trenton, NJ
    • School Result
    • Part Time
  • Medicaid Advanced Planning Writer

    • United States
    • My3Tech Inc
    • Full Time

Copyright © 2026 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme