[mdlug] UNIX tips: Learn 10 good UNIX usage habits
Michael Corral
micorral at comcast.net
Mon Mar 10 03:19:16 EDT 2008
2008-03-10, Monsieur Robert Citek a ecrit:
> contrast the output of these commands:
>
> $ cat /etc/passwd /etc/group | grep root
> $ grep root /etc/passwd /etc/group
grep -h root /etc/passwd /etc/group
That will give the same output as the cat+pipe version.
So calling cat is unnecessary in this example, since the one grep
command does the same as two commands and a pipe.
In my experience I've found that calling cat is unnecessary about 95%
of the time.
Michael
More information about the mdlug
mailing list