While scripting it is necessary to gather entries from administrative database such as passwd, group files or services, protocols or networks etc. Traditionally grep is choice of all UNIX administrators but recently I found GNU getent command. The command is quick, saves time:
The getent program gathers entries from the specified administrative database using the specified search keys. For example:
$ getent passwd vivek
$ getnet group admins
$ getent protocols vrrp
$ getent services www
Overall, it supports following databases:
- ahosts
- ahostsv4
- ahostsv6
- aliases
- ethers
- group
- hosts
- netgroup
- networks
- passwd
- protocols
- rpc services
- shadow
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins

- My 10 UNIX Command Line Mistakes
- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
Facebook it - Tweet it - Print it -
We're here to help you make the most of sysadmin work. So, subscribe!

{ 1 comment… read it below or add one }
please help to learn further