G Gabriel Turqos Active Member Joined Mar 11, 2019 Messages 17 May 26, 2020 Thread Author #1 Iwant to list only users names in a Linux system byusing the /etc/passwd file.
Solution Neemobeer May 26, 2020 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
Neemobeer Windows Forum Team Staff member Joined Jul 4, 2015 Messages 8,998 May 26, 2020 #2 awk -F: '{ print $1}' /etc/passwd will give you just usernames or you can do something similar with cut Upvote 1 Downvote Solution
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 Messages 17 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 Upvote 0 Downvote
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