Pages

Thursday, June 1, 2017

How to Use ‘cat’ and ‘tac’ Commands with Examples in Linux

This article is a part of our Linux Tricks and Tips series, in this article we will cover some basic usage of cat command (most frequently used command in Linux) and tac (reverse of cat command – print files in reverse order) with some practical examples.

Basic Usage of Cat Command in Linux

Cat command, acronym for Concatenate, is one of the most used commands in *nix systems. The most basic usage of the command is to read files and display them to stdout, meaning to display the content of files on your terminal.

# cat file.txt
View Content of File in Linux
View Content of File in Linux
Another usage of the cat command is to read or combine multiple files together and send the output to a monitor as illustrated in the below examples.
# cat file1.txt file2.txt file3.txt
View Content of Multiple Files
View Content of Multiple Files
The command can also be used to concatenate (join) multiple files into one single file using the “>” Linux redirection operator.

      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n5X5g
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment