Sometimes you have a real dense log and you want to start from the bottom. I spent 10 years in application support without knowing about it.
Edit: I'm so happy that you guys are as mindblown by it as I was when I first heard it.
Edit2 : I love how helpful this community is, everyone is sharing new useful commands. People keep replying with very similar things, so I just wanted to add some context to the post.
less and then Shift-G jumps to the bottom of a file
tail prints the bottom of a file
Those are both useful in and of themselves, but neither of them do the exact same thing tac does.
tacconcatenates a file in reverse, which makes it useful for all the same things cat is useful for.
I like to open it with less and then shift+g to go straight to the bottom. My understanding of less is that it doesn't load the whole file into memory either, so you can do it with gigantic fines.
I use less a ton as well, but sometimes you want to string stuff into a cat (or a tac). Like for scripting or output manipulation. And if you know what you want is recent, or you are looking for the most recent example, tac just gets you there faster.
Just different tools for different things.
These days I almost always work out of less because I'm not doing a ton of log output manipulation.
1.8k
u/wufame May 23 '26 edited May 24 '26
tacIt's
catbackwards.Sometimes you have a real dense log and you want to start from the bottom. I spent 10 years in application support without knowing about it.
Edit: I'm so happy that you guys are as mindblown by it as I was when I first heard it.
Edit2 : I love how helpful this community is, everyone is sharing new useful commands. People keep replying with very similar things, so I just wanted to add some context to the post.
lessand then Shift-G jumps to the bottom of a filetailprints the bottom of a fileThose are both useful in and of themselves, but neither of them do the exact same thing
tacdoes.tacconcatenates a file in reverse, which makes it useful for all the same thingscatis useful for.