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:  3 Ways To Fix “No Space Left on Device” Error In Linux
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

remote desktop apps Best Linux Remote Desktop Apps To Share Your Desktop Linux
Fix “Updating from such a repository can’t be done securely” Error In Linux Fix “Updating from such a repository can’t be done securely” Error In Linux Fix
Meet Raspberry Pi Pico, Raspberry Silicon From Raspberry Foundation [Specs] Meet Raspberry Pi Pico, Raspberry Silicon From Raspberry Foundation [Specs] Linux
How To Change MAC Address in Linux How To Change MAC Address in Linux Linux
Linux Interview Questions For Beginners In 2020 Linux Interview Questions For Beginners In 2020 Linux
Set The Default Terminal Emulator On Ubuntu 18.04 LTS Set The Default Terminal Emulator On Ubuntu 18.04 LTS ubuntu 18.04

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]
  • Prepared Foods Order Writer (Deli / Culinary – Buyer / Inventory Replenishment) – Full Time

    • Thayne, WY
    • Whole Foods Market
    • Full Time
  • Sr. Risk and Controls Compliance Policy Writer (on-site Phoenix, Chicago, San Fran)

    • San Francisco, CA
    • INSPYR Solutions
    • Full Time
  • Artificial Intelligence & Gen AI Engineer – Tampa, Hybrid

    • Tampa, FL
    • Citigroup Inc
    • Full Time
  • Sr. Technical Documentation Specialist – REMOTE

    • Atlanta, GA
    • HHS Technology Group, Inc.
    • Full Time
  • TECHNOLOGY VICE PRESIDENT, ARTIFICIAL INTELLIGENCE & MACHINE LEARNING AND DATA

    • Falls Church, VA
    • NLP PEOPLE
    • Full Time
  • Architectural Drafter

    • Sarasota, FL
    • Start To Finish Drafting
    • Full Time
  • Senior or Principal Data Scientist – Technical AI Ethicist

    • Seattle, WA (Remote)
    • salesforce.com, inc.
    • Full Time
  • Artificial Intelligence (AI) Data Scientist

    • Fairfax, VA
    • General Dynamics Information Technology
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme