5 ms·
If you’re working with a lot of data you probably want to pipe it into head anyway, initially, so <file head -n50 | whatever Can be the starting command. When
by jpxw 7y ago
If you’re working with a lot of data you probably want to pipe it into head anyway, initially, so
<file head -n50 | whatever
Can be the starting command. When you no longer need the head there, just get rid of “head |”.
Although I agree that the pointing out of “useless cat” is usually not particularly useful or constructive.
- robertelder 7y agoUsing head when there's lots of data make sense, but I really don't see any advantage to avoiding useless cat. Useless cat is way faster to type and make additions to. I sort of get the feeling that 'useless cat' is really just a fun copypasta kinda like when people like post "I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it..."
- drran 7y agoIt's still good to be aware about `useless cat`, to save some CPU and I/O, when converting one liners into scripts.
- heliodor 7y agoRather than using head and worrying about the size of the file, it is easier to simply use "useless" cat then ctrl-c the stream of data that comes out.