I saw the getent command on a video yesterday, which can be used to view related records in the system's database, for example:
[Email protected]:~$ getent hosts GUOLIANGC 10.10.3.1 GUOLIANGC
[Email protected]:~$ getent passwd MySQL Mysql:x:1003:1003::/home/mysql:/bin/sh
|
[email& nbsp;protected]:~$ getent--help Usage: getent [Options ...] database [key ...] Get entries from administrative database. -S,--service=config the service configuration to use -?,--help give the system Help list --usage Give a brief usage information -V,--version Print Program version number the Long option is mandatory or optional for a short option that corresponds to a mandatory or optional parameter. Supported databases: ahosts ahostsv4 ahostsv6 aliases ethers group Gshadow hosts Netgroup Networks passwd protocols RPC s Ervices Shadow for the bug reporting instructions, please see: . |
Where the shadow database can only be viewed by the root user.
This article from the "Linux-related technology" blog, declined to reprint!
The Linux getent command