egrep
egrep [xyz] /etc/passwd egrep x:[0-9]{3} /etc/passwd egrep ^r /etc/passwd egrep '[bash!false]' /etc/passwd For example, the following will display either Manager or Developer (bot ignore Sales). $ egrep 'Manager|Developer' employee.txt | grep -v Sales