V
Vahid Moghaddasi
Hi,
I have been trying to sort -u the password file /etc/passwd by its
first field (username) but for some reason sort is giving me a wrong
result. This is what I used:
"sort -t : -k 1,1 /etc/passwd" I do not use -u to see the result of the
sort command.
In the passwd file, I have the first 5 lines copied to the buttom of
the file (duplicate system accounts, root,daemon,bin,sys,adm with
different uid,gid's ) I have the users in the middle.
When I sort -u, I would like to see either the top 5 system users or
the bottom ones but I see one from top, one from the bottom and so on.
There is no pattern to the output, it seems that -k 1,1 does not have
any effect at all.
I would appreciate if someone shed a light on this or paste a function
to do the sort for me.
I need to sort by username and in another function by UID.
Thanks,
Vahid.
I have been trying to sort -u the password file /etc/passwd by its
first field (username) but for some reason sort is giving me a wrong
result. This is what I used:
"sort -t : -k 1,1 /etc/passwd" I do not use -u to see the result of the
sort command.
In the passwd file, I have the first 5 lines copied to the buttom of
the file (duplicate system accounts, root,daemon,bin,sys,adm with
different uid,gid's ) I have the users in the middle.
When I sort -u, I would like to see either the top 5 system users or
the bottom ones but I see one from top, one from the bottom and so on.
There is no pattern to the output, it seems that -k 1,1 does not have
any effect at all.
I would appreciate if someone shed a light on this or paste a function
to do the sort for me.
I need to sort by username and in another function by UID.
Thanks,
Vahid.