Want a list of users on your FreeBSD?

If you ever want a list of users on your system, use this little script:
cat /etc/passwd | cut -d: -f1 | grep -v \#

The cut command selects portions of a file. Use ":" as the delimiting character. And we want only the first field. The grep eliminates lines with # in them, which normally appear at the start of the password file. Exercises for the interested and motivated:

  • try the above command without the grep
  • remove the \ before the #
  • try -f5 instead of -f1.

Hope that helps.

Thank's to : The FreeBSD Diary

Add comment

Thanks for your comment


Security code
Refresh

Words

  • Character is like a tree and reputation like a shadow. The shadow is what we think of it; the tree is the real thing. "Abraham Lincoln"
  • Imagination is the key to my lyrics. The rest is painted with a little science fiction. "Jimi Hendrix"
  • The leader of genius must have the ability to make different opponents appear as if they belonged to one category. "Adolf Hitler"
  • The art of leadership... consists in consolidating the attention of the people against a single adversary and taking care that nothing will split up that attention."Adolf Hitler"
  • Courage is what it takes to stand up and speak; Courage is also what it takes to sit down and listen. "Winston Churchill"

About You :

IP Address :
38.107.179.244
United States United States
Browser :
Unknown Unknown
Operating System :
Unknown Unknown

Keep This Site Alive

Your Comments on Tips and Tricks:

Banner
Copyright © 2012 MustNoFee
This blog is 1.485 days since Jan, 12 2008