3 ms·
A little off topic, but reading from week one include a Unix/Emacs tutorial. I wish they would stop defining "cat" as a command to "displays the content of spec
by babarock 15y ago
A little off topic, but reading from week one include a Unix/Emacs tutorial. I wish they would stop defining "cat" as a command to "displays the content of specified files". This trend in the "Unix teaching" community is leading to a lot of terrible practice (Useless use of Cat) in the industry.
I die a little every time I see
$ cat file | grep word
- micaeked 15y agocan you please clarify: - correct definition of 'cat' - what is wrong with '$ cat file | grep word" edit: formatting
- kc5tja 15y agoCorrect definition of 'cat' -- a tool to concatenate one or more files sequentially into a single output stream. E.g., cat file1 file2 file3 >output-file what is wrong with... -- "grep word file" takes fewer keys to type and uses fewer resources (important on a heavily loaded server with tons of processes which may well prove compromised and you're trying to peruse the logs for evidence. Been there, done that, got the t-shirt, and donated it to the local shelter).
- notajith 15y agoPeople nag me about cat'ing stuff to grep, and I explain that it's just easier to edit the pattern when it is the last argument to the command. Also it of course fits better in the toolchain when I need to replace the input or the grep with something else.