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 passwdDepending 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/bashThis is interpreted as:
testox10011001Testo0012-345678903-45678912supervisor floor B1/home/testo/bin/bashIn 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.