[CentOS] Sorting of passwd/group files

Sat Apr 1 13:31:13 UTC 2006
Kai Schaetzl <maillists at conactive.com>

Tony Schreiner wrote on Fri, 31 Mar 2006 11:39:24 -0500:

> sort -t: +0 /etc/passwd >outfile-byname 
> sort -t: -n +2 /etc/passwd >outfile-byuid 
> ? 

Ah, great, thanks, Tony! I know some of the old Unix shell commands can do 
really neat things, but i tend to forget about them, I didn't "grow up" 
with them. If there hadn't been any feedback I would have resorted to 
coding this in Perl, much of a waste of time.

>  
> for what purpose do you need this?

It helps in comparing between machines. And it helps much when you 
transfer users from one machine to another. I just snip them out in the 
relevant files and add them on the other machine. Usually something like 
all users above uid 10000 or so. If the list isn't sorted it's a bit 
harder to do that.

Kai

-- 
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com