Linux tac commandThe 'tac' command is the reverse of the 'cat' command. It is also known as 'cat' backward. It will display the file content in reverse order. It prints the last line first, then second last and so on. Such way, it prints the first line at last. Syntax: Example: Look at the above snapshot; we have displayed the file 'count' with both the commands 'cat' and 'tac' to show the difference between the two. To Separate The ContentThe 'tac --separator' command will separate the content from the mentioned string or keyword from the rest of the file content. Syntax: Example: Look at the above snapshot, in the first example; we have separated the content of file 'count' from the string "two" to the rest of the content with the help of 'tac count --separator "two" ' command. Then, we separated the content from the string "five" and "one" in the next examples. Next TopicLinux more |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India