G Gabriel Turqos Active Member Joined Mar 11, 2019 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 Joined Jul 4, 2015 Location Colorado 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 Joined May 31, 2019 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