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 No Comments on 10+ Basic Cat Command Examples in Linux [2023]

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 Free Linux Logfile Viewers
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

How To Mount Windows Share On Ubuntu Distro How To Mount Windows Share On Ubuntu 22.04 LTS How To Ubuntu
OBS Linux 2023 Install OBS In Linux Operating System [2023] Linux
How To Install Ubuntu Studio DE On Ubuntu 22.04 LTS How To Install Ubuntu Studio DE On Ubuntu 22.04 LTS Linux
How To Upgrade To Xfce 4.18 on Ubuntu How To Upgrade To Xfce 4.18 on Ubuntu How To Ubuntu
Fix sudo apt-get install openssh-server not working error : Enable SSH Server on Ubuntu Fix sudo apt-get install openssh-server not working error : Enable SSH Server on Ubuntu Linux
20+ Best Lightweight Linux Operating Systems Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • 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
  • Linux Wget Examples September 27, 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 [email protected]
  • Grocery Order Writer (Buyer / Inventory Replenishment) – Full Time

    • Sedona, Yavapai County, AZ
    • Whole Foods Market
    • Full Time
  • Technical Writer

    • Austin, TX
    • Allied Consultants, Inc.
    • Full Time
  • Technology, Data, and Artificial Intelligence (AI) Subject Matter Expert (SME) – Department of State

    • Washington DC
    • Censeo Consulting Group
    • Full Time
  • Technical Writer

    • Austin, TX
    • AllSTEM Connections
    • Full Time
  • Technical Writer

    • Plano, TX
    • Optomi
    • Full Time
  • Analyste fonctionnel SAP Fieldglass (contrat 24+ mois)

    • Canada
    • DELAN - Chasseurs de Talents en TI
    • Full Time
  • Principal Data Scientist ($1M)

    • Fremont, CA (Remote)
    • Stabile Search
    • Full Time
  • Technical Writer

    • Erie, PA
    • Akkodis
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme