getent

2013-06-14

getent – get entries from administrative database

1.获取用户
getent passwd |awk -F":" '{print $1}' >> user.txt
2.awk '{print $1}' user.txt |xargs getent shadow >> shadow.txt
3.getent group
4.getent hosts (替换此命令和cat /etc/hosts的区别)
5.getent services
6.Aix:
lsuser: The lsuser command displays the user account attributes.
lsgroup: The lsgroup command displays group attributes.
7.sed -i 's/:::::::0//g' shadow.txt 只保留用户密码

分类:Linux | 标签: |

相关日志

评论被关闭!