SHΛRK@lemmy.zip to Programmer Humor@programming.dev · 3 days agoLinux Catlemmy.zipexternal-linkmessage-square61linkfedilinkarrow-up1394arrow-down17file-text
arrow-up1387arrow-down1external-linkLinux Catlemmy.zipSHΛRK@lemmy.zip to Programmer Humor@programming.dev · 3 days agomessage-square61linkfedilinkfile-text
minus-squareSprocketfree@sh.itjust.workslinkfedilinkEnglisharrow-up3·2 days agoI’ve always wondered what a good use case for tac would be…
minus-squarerumba@lemmy.ziplinkfedilinkEnglisharrow-up3·2 days agoReverse chronological order, mostly tac log.txt |head # would give you newest first no good for sort because sort already supports -r no need it for tail on large files because tail already skips to the end. I do a lot of impromptu bash to sus crap out of logs. when you’re balls deep in cat log|grep -v foo| rev|cut -f 1-3 -d \ | |rev Sometimes tac comes in clutch.
minus-squareSprocketfree@sh.itjust.workslinkfedilinkEnglisharrow-up4·2 days agoThat’s fair. I’d usually just use less and drop to the end. My use cases would always need the older log before a newer log though because that’s the start of the problem. At least that’s how I operate.
I’ve always wondered what a good use case for tac would be…
Reverse chronological order, mostly
tac log.txt |head # would give you newest first
no good for sort because sort already supports -r
no need it for tail on large files because tail already skips to the end.
I do a lot of impromptu bash to sus crap out of logs.
when you’re balls deep in
cat log|grep -v foo| rev|cut -f 1-3 -d \ | |rev
Sometimes tac comes in clutch.
That’s fair. I’d usually just use less and drop to the end. My use cases would always need the older log before a newer log though because that’s the start of the problem. At least that’s how I operate.