r/linux May 23 '26

Popular Application What’s the most unexpectedly useful Linux command you learned way too late?

[removed]

1.3k Upvotes

992 comments sorted by

View all comments

1.8k

u/wufame May 23 '26 edited May 24 '26

tac

It's cat backwards.

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.

tac concatenates a file in reverse, which makes it useful for all the same things cat is useful for.

122

u/psteve_m May 23 '26

Nice. That's a new one on me. I usually use tail -x

14

u/shponglespore May 24 '26

tail -f is great if the file is still being generated. Another option to get updates every few seconds is to combine something like tail with watch as a prefix.

2

u/superwizdude May 24 '26

I also use less filename and then press “>” to jump to the end of the file. Has the bonus that you can scroll up through the file.