//View Tip #258
» Actively Monitor a File
» Simple password generator
» Loop over files with spaces in the name
» swap files
Similar Tips
» Filter stderr for cron jobs» Actively Monitor a File
» Simple password generator
» Loop over files with spaces in the name
» swap files
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
I use the following to list non-system users. It should be portable though won't work on systems without the getent command.
alias lsusers='getent passwd | tr ":" " " | awk "\$3 >= $(grep UID_MIN /etc/login.defs | cut -d " " -f 2) { print \$1 }" | sort'Comments
Add your comment
Comments are currently disabled


<pre>alias lsusers='awk -F : "\$3 >= $(grep UID_MIN /etc/login.defs | cut -d " " -f 2) { print \$1 }" /etc/passwd | sort'</pre>