[root@P1QMSMDW01 ~]# getent passwd gpadmin gpadmin:x:530:530::/home/gpadmin:/bin/bash [root@P1QMSMDW01 ~]# [root@P1QMSMDW01 ~]# [root@P1QMSMDW01 ~]# getent group gpadmin gpadmin:x:530: [root@P1QMSMDW01 ~]# getent passwd root root:x:0:0:root:/root:/bin/bash [root@P1QMSMDW01 ~]#
[root@P1QMSMDW01 ~]# getent hosts P1QMSMDW01 192.168.3.60 P1QMSMDW01 [root@P1QMSMDW01 ~]#
获取用户家目录
HOME="${HOME:-$(getent passwd $USER 2>/dev/null | cut -d: -f6)}" [09-15 13:49:40] root@pg-meta-1:~/pigsty $ getent passwd $USER 2>/dev/null | cut -d: -f6 /root