Linux Reader
Access files and folders on Ext, UFS, HFS, ReiserFS, or APFS file systems from Windows

Pew Pew madafakas!

Access files and folders on Ext, UFS, HFS, ReiserFS, or APFS file systems from Windows
Last updated: Jul 29, 2021

Examples of Bash Cat Command

Here you will find out:

  • what is cat command
  • examples of cat command
  • when DiskInternals can help you

Are you ready? Let's read!

Cat command in Linux

Cat, which is short for concatenate, is one of the most commonly used commands in Linux and other Unix-like operating systems.

The cat command allows us to create single or multiple files, view file inclusions, concatenate files and redirect output in a terminal or file.

In this article, we will show you some handy uses of the cat command and examples of it in Linux.

Concatenation:

Cat has three related functions related to text files: displaying them, merging their copies, and creating new files.

The general syntax of a cat command is:

Concatenation syntax

Square brackets indicate that the accompanying items are optional.

Examples:

Here are 10 Bash cat commands and cat shell commands for you to practice:

  1. 1. How to view a single file:
cat - preview a single file

This command will show you the contents of the file name.

  1. 2. How to use the cat command to view multiple files:
cat - preview a multiple files

This command will show you the content of file1 and file2.

  1. 3. How to view the file's contents starting with the line number
cat - preview a file starting with a number
  1. 4. How to create a file with cat command in Linux
cat - create a file
  1. 5. How to copy the content of the one file to another
cat - copy content of the file
  1. 6. How to suppress repeated blank lines in the output
cat - suppress repeated blank lines
  1. 7. How to append the contents of one file to the end of another file
cat - append the contents of one file to the end of another file
  1. 8. How to use the tac command to display content in reverse order
cat - use the tac command to display content in reverse
  1. 9. How to highlight the end of a line
cat - highlight the end of a line
  1. 10. In case if you want to use the -v, -E and -T options at the same time, you can use only the -A command-line option instead of writing -vET in the command
cat - a option

Linux Reader as an explorer to access Linux files on Windows

If you’re reading this article about the Unix cat command, there is a lot more that you might need to do on your computer.

If you want to easily mount or read Linux files on your Windows operating system, DiskInternals Linux Reader will help you do just that.

With its easy-to-use UI and powerful design, you can easily mount or read your Linux filesystems on Windows.

Related articles

FREE DOWNLOADVer 4.19, WinUpgrade to PROFrom $29.95

Please rate this article.
53 reviews