How do I get a single entry from group, password file?
-
An east way of getting an entry from database file like /etc/group, /etc/passwd, etc
$ getent group opscode opscode:x:750:opscode
or from the password file
$ getent passwd opscode opscode:x:750:750::/opt/opscode/embedded:/bin/sh
Any database file support by the name service switch libraries, file mainly found in /etc/nsswitch.conf
© Lightnetics 2024