Search code examples
linuxredhat

How would I get all users whose first character in their logins is 'g'?


Please, any one help me in getting all users whose first character in their logins is 'g' ?


Solution

  • cat /etc/passwd | cut -d ":" -f 1 | egrep "^g"
    

    is enough?