首页 > 其他 > 详细

getent命令 – 查看记录

时间:2020-12-20 10:46:36      阅读:28      评论:0      收藏:0      [点我收藏+]

getent命令 – 查看记录

 

Linux getent命令用来查看系统的数据库中的相关记录。

即使这些数据库不是在本地,比如ldap或者nis中的数据库, 也可以使用getent察看。长选项的强制或可选参数对对应的短选项也是强制或可选的。

支持的数据库: ahosts,ahostsv4 ,ahostsv6, aliases ,ethers ,group, gshadow, hosts, netgroup, networks, passwd, protocols, rpc ,services, shadow,例如:getent protocols , getent services, getent rpc等。

语法格式:getent [参数]

常用参数:

-s 要使用的服务配置
-help 给出该系统求助列表
-usage 给出简要的用法信息
-V 打印程序版本号

参考实例

从hosts库中得到linux.com的IP信息:

[root@linuxcool ~]# getent hosts linuxcool.com
182.149.160.47  linux.com
200.181.57.217  linux.com
123.125.15.144  linux.com

从passwd库中得到账号tank信息:

[root@linuxcool ~]# getent passwd tank
tank:x:502:502::/home/tank:/bin/bash

输出getent命令简要用法列表:

[root@linuxcool ~]# getent -help

getent命令 – 查看记录

原文:https://www.cnblogs.com/songhaibin/p/14162493.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!