3 ms·
Cat is useless in that line: $ grep " 80/tcp" /etc/services http 80/tcp www www-http # WorldWideWeb HTTP http://partmaps.org/era
by reidrac 15y ago
Cat is useless in that line:
$ grep " 80/tcp" /etc/services
http 80/tcp www www-http # WorldWideWeb HTTP
http://partmaps.org/era/unix/award.html#cat http://partmaps.org/era/unix/award.html#cat
- deno 15y agoIt's not useless. With cat, I don't have to remember the order of grep's arguments.
- reidrac 15y agoInteresting. With grep you need at least something to search (one argument), don't you? If you don't provide another argument to say "where", it reads from standard input (as most unix commands). But you already know that because you're using it that way with cat. How can you don't remember then the order of the arguments?
- deno 15y agoThere: > {1} With grep you need at least something to search (one argument), don't you? {2} If you don't provide another argument to say "where", it reads from standard input (as most unix commands). And ‘find’ is the other way around. I just don't see any reason to not to use cat. It's not like grep will use fseek() to speed anything up, if I call it with file URI instead.
- iSloth 15y agoI too would cat the file first, just get in the habit of doing it.