It's never good if we could not obtain user information from the Linux OS. This section guides you on how to get Linux user information from the Linux operating system.
There are 2 ways to get the user information.
In this case, you can list all the users available in the system. The command is:
$ getent passwd
Depending on execution permission, this will return not just the user created account but also system level groups like nobody or root. Also, you notice that each users has some comma information. The return value can be:
testo:x:1001:1001:Testo,0,012-3456789,03-45678912,supervisor floor B1:/home/testo:/bin/bash
This is interpreted as:
testo
x
1001
1001
Testo
0
012-3456789
03-45678912
supervisor floor B1
/home/testo
/bin/bash
In this case, you can get specific user from the list query. The command is:
$ getent passwd | grep "<name / username / query info>"
This will query the specific user from the list using your keywords.
That's all for getting user info from an Linux operating system.