Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望添加getent命令 #483

Closed
QuTaoa opened this issue Apr 3, 2023 · 1 comment
Closed

希望添加getent命令 #483

QuTaoa opened this issue Apr 3, 2023 · 1 comment

Comments

@QuTaoa
Copy link

QuTaoa commented Apr 3, 2023

getent命令来自于英文词组“get entries”的缩写,其功能是用于查看系统数据库中的记录信息。即便这些数据库不是本地的,类似于LDAP或者NIS也可以使用getent命令进行查看。

语法格式:getent [参数]

常用参数:

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

参考实例

查看本地的主机文件(/etc/hosts)中包含的指定域名信息:
[root@linuxcool ~]# getent hosts linuxcool.com
182.149.160.47 linuxcool.com

查看本地的密码文件(/etc/passwd)中包含的指定用户信息:
[root@linuxcool ~]# getent passwd linuxprobe
linuxprobe:x:1000:1000:linuxprobe:/home/linuxprobe:/bin/bash

jaywcjlove added a commit that referenced this issue Apr 3, 2023
github-actions bot added a commit that referenced this issue Apr 3, 2023
@jaywcjlove
Copy link
Owner

@QuTaoa 已经添加,欢迎补充

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants