By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,027 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,027 IT Pros & Developers. It's quick & easy.

List Only Usernames

P: 15
Iwant to list only users names in a Linux system byusing the /etc/passwd file.
May 26 '20 #1
Share this Question
Share on Google+
1 Reply

P: 134
Expand|Select|Wrap|Line Numbers
  1. $ cut -d: -f1 /etc/passwd
  2. $ cat /etc/passwd | sed -e 's/:.*//g'
  3. $ awk -F":" '{ print $1 }' /etc/passwd
Use one of three command lines.
If you want to show in each page of the screen, add "| more".
May 27 '20 #2

Post your reply

Sign in to post your reply or Sign up for a free account.