13 Basic Cat Command Examples in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

32 Responses

  1. doesn't matter says:

    #ZombieRessurection – please do not spread bad practices

    cat | more file” is not smart as “cat file file | sort > newfile” isn’t
    use
    less file
    or
    sort file file > newfile

    for selecting rows comfortable use sed instead:

    sed -n '4,6p' file
    

    will print lines 4-6 from

  2. Jacob says:

    Sir I am a Linux newbie, can you please say the ways to learn all Linux commands.

  3. Arun says:

    12. Redirecting Multiple Files Contain in a Single File

    still the type in contain

  4. Kent says:

    Thanks. Just a little help about spelling of a word used frequently. “Contains”. I think you want “Contents”.

    • Ravi Saive says:

      @Kent,

      Oops what a big mistake and was not realized or pointed by anyone so far, thanks a ton Kent for notifying us, we’ve replaced the word contains with content in the writeup..really thankful to you..

  5. dan says:

    will you teach me how to do this on windows please

    • Ravi Saive says:

      @Dan,

      You mean on Windows 10 with Bash on it? If you have Bash installed on your Windows, all cat command examples shown here will work without any errors..

  6. Chandra says:

    Hi Ravi thanks.

    How can I select lines (i.e. rows) 10 to line 15 from a given file, let, ABC.txt, using cat command:

    Suppose I use the following command for getting the first 20 lines and 10 columns of the file ABC.txt which contains a table

    $ cat ABC.txt | head -20| cut -f1-10 
    

    Looking forward.

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.