VSZ RSS SZ CMD
3252 1608 813 /bin/cat
To me there are far more things to worry about than cat. How about your multi-gig browser for one ?Now for firefox:
VSZ RSS SZ CMD
3472212 395968 868053 /usr/lib64/firefox/firefox
Maybe people should be looking at that ? I will not even get into modern Linux Desktops :)When you're building a pipeline, putting cat first can often be quite convenient. Essentially, it's more composable: it defines the input to the pipeline without committing to a specific tool. For example, you can up-arrow in the shell and change the part after the pipe without having to skip back past the filename.
In fact if you don't start with cat, it's possible you're more of a script kiddie than a software developer.
< file grep abc
Chrome probably spawned two processes when I cmd+clicked this into a new tab. It really doesn't matter.
- various HostGator employees, c. 2011
cat file | wc -l => wc -l < file
cat file | head -n 5 => head -n 5 file
cat file | awk '{print $1}' => awk '{print $1}' file
cat file | sort => sort file
Do this instead: cat file | wc -l => <file wc -l
cat file | head -n 5 => <file head -n 5
cat file | awk '{print $1}' => <file awk '{print $1}'
cat file | sort => <file sort
The front-cat abuse is all about the order. The effective solution needs to keep the relative order of arguments. cat file > /dev/null 2>&1
work as intended.(who gives even a single shit, my god)
petee•2h ago
http://catb.org/jargon/html/U/UUOC.html
Admittedly its taken me a long time to remember that the file is the last argument to grep, when so many other commands its the first. I'd guess common abuse is due to being easier to type cat x | than to dig up the man page
smelendez•52m ago
soraminazuki•45m ago
I guess the file is usually the last argument because it's the one that can be omitted.
js2•43m ago