Unix TAC Command

This is a quick post about a very cool utility, the Unix TAC command.

Any one who’s been on Unix would likely have encountered the CAT command.

The TAC command, just like it sounds, functions exactly opposite to the CAT command. It works on a file backwards.

This is especially useful, if you’re into live troubleshooting situations and you ask a user to generate some traffic so that you could check the live logs.

Now if you use the CAT command, and your syslog file happens to be a large one, it could take a while before any interesting logs pop up.

But with the TAC command, its just going to be like boom… Live logs would pop up right away!

Here’s a quick example of the TAC command:

[root@certvideos ~]# cat sample.txt
This is a test file,
to check the difference
between CAT and TAC commands!
[root@certvideos ~]#

[root@certvideos ~]# tac sample.txt
between CAT and TAC commands!
to check the difference
This is a test file,
[root@certvideos ~]#

Unix Toolbox is a great book that I’d recommend to you for learning Unix commands and utilities.

Add a Comment

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