r/ProgrammerTIL • u/trkeprester • Jan 25 '22
Other TIL doing 'less' on a tar file will give detailed listing of files in the tar
with the 'less' viewing controls, naturally. never need to type `tar -tf blah.tar.gz | less` again!
138
Upvotes
39
u/GiantRobotTRex Jan 25 '22
I believe this is system dependent (but works on most modern systems).
More specifically,
lesscan't actually do this itself. But the LESSOPEN environment variable can specify a preprocessor command that is run on inputs toless. And most modern systems will have that variable set to run thelesspipecommand which actually does support compressed archives.If you run
lesswith-L(or--no-lessopen), then compressed archives won't work.18
u/HobaSuk Jan 25 '22
Thanks for tip. Also today I learnt about watch command. Where you can watch the changes of outpıt of a command. I used it like watch “cat <> | grep <> [ | tail]”. Wanted to share.