Displaying 1 result from an estimated 1 matches for "pgstud".
Did you mean:
pgstes
2012 Aug 15
5
Extract lines from text file
Hi,
I'm looking for a command to extract lines from a large text file, a
password file. A typical user has a username made from a letter
followed by their id-number.
m9718508:pw:9301:840: Lynch :/home/pgstud/m9718508:/bin/bash
So for instance if I need to extract lines where;
the 1st field, the username begins with an m
and
the 4th field, the group contains exactly 850
cat passwdfile | grep ^m | grep 850 > output
is close but fails if the value 850 appears outside the 4th field. In
the above ex...