In Linux systems, the two most important files for user account management are/etc/password and/etc/shadow.
In the/etc/password file, each line represents an account, but there are many accounts that are system accounts. Like what:
Bin, ADM, etc., as well as administrator account root. The rest is for general user accounts.
Each line is composed of (to: Split):
1 account name;
2 password (combined with/etc/shadow);
3 UID User ID, where 0 is the root, 1~499 is the system user account, and the general users account.
As a result, all users (general users) under Linux can be obtained according to the scope of the UID.
You can use the shell command to get:
cat/etc/passwd | Awk-f: ' $3>=500 ' | Cut-f 1-d:
Output the/etc/passwd file, processing each row, judging by a colon: the third element of the split, extracting the rows greater than 500, and using cut to output the first column (user account name).
Test system: Fedora release 9 (sulphur) kernel:2.6.25
View all users under Linux (Shell scripting get)