4 ms·
Sorry for the (perhaps) simple question, but why pipe zcat to dd? Doesn't this do the same thing as regular gunzip? Or do you prefer the zcat | dd so you can v
by flumpcakes 5y ago
Sorry for the (perhaps) simple question, but why pipe zcat to dd?
Doesn't this do the same thing as regular gunzip? Or do you prefer the zcat | dd so you can view progress?
- dgfitz 5y agoWell I needed to pipe the output to dd either way. You’re correct gunzip piped to dd works just as well. I’m a reason useless cat is a thing. =)
- iso1631 5y agoPeople often say "you can refactor that line and save a useless invocation of cat" cat /var/log/file.log Output too long, so Press Up, |grep -e useful -e lines cat /var/log/file.log|grep -e useful -e lines OK, that looks fine, but I want to tail it Press Up, Home, deldeldel, tail -f (other terminal modes are available) tail -f /var/log/file.log|grep -e useful -e lines Exact same command no matter what grep -e you have. You separate the filtering logic from the accessing logic. You can work on one side without worrying about the other. Want to change from cat to bzcat, or tail, or tac, or nc? No problem. Want to add a pre-filter (say strip snmpd errors before you add -n to number your matches in grep), it all stays the same. Now imagine this without "useless" cat less /var/log/file.log Press Up, Home, deldeldeldelgrep -e useful -e lines grep -e useful -e lines /var/log/file.log Then either Press up, home, del(n times), tail, end, | grep -e useful -e lines Or Press up, up, |grep -e useful -e lines, home, deldeldel, tail -f Cognative break, extra typing, potentially having to look at what you're typing too rather than muscle memory, all because someone says "cat is useless". My computer isn't from 1965, I don't need to justify every process I run.