List All Users and Groups in Linux

In: Ubuntu or Linux

24 Nov 2008

Recently 2 out of 3 of the server raid hdd went dead, so I need to setup a replacement server real quick. One of the dilemma I am facing is needing to recreate all user accounts. My eyes are already too tired to look through the /etc/passwd file. Since I only need to list out alll users except the system account so I just use the command below:

awk -F: ‘{if ($3>=500 && $3<=1000) print $1}’ /etc/passwd

You can also make it as shell script if you need to use that on the regular basis.

Comment Form

About this blog

This is a place I create just for fun and to write down some experience and notes for myself. So feel free to enjoy and drop any comments you have. I had been employed as Programmer, System Analysts, System Administrator, DBA and Project Manager. I will share some of my case study here as well. Enjoy!

 

Calendar

September 2010
M T W T F S S
« Jul    
 12345
6789101112
13141516171819
20212223242526
27282930