G Gabriel Turqos Active Member May 26, 2020 #1 Iwant to list only users names in a Linux system byusing the /etc/passwd file.
Neemobeer Cloud Security Engineer Staff member May 26, 2020 #2 awk -F: '{ print $1}' /etc/passwd will give you just usernames or you can do something similar with cut
awk -F: '{ print $1}' /etc/passwd will give you just usernames or you can do something similar with cut
edizgeorgi Active Member May 27, 2020 #3 You can use the cut command which will select the specified column. $cat /etc/passwd | cut -d : -f 1 Reference:How To List All Users and Groups in Linux – POFTUT
You can use the cut command which will select the specified column. $cat /etc/passwd | cut -d : -f 1 Reference:How To List All Users and Groups in Linux – POFTUT