I want help to print only one name from my /etc/passwd file. For example, if there are two entries named avi and avig, then how should I print only avi? I have tried cut, unique command but am not getting proper output.
How to print unique name in UNIX using command
shell script;text processing;passwd
You need to anchor the string you're searching for. Try egrep '^avi:' /etc/passwd. 