{"id":21,"date":"2007-09-10T09:17:20","date_gmt":"2007-09-10T01:17:20","guid":{"rendered":"http:\/\/www.sysadmindayph.com\/blog\/?p=21"},"modified":"2007-09-10T09:17:20","modified_gmt":"2007-09-10T01:17:20","slug":"the-getent-command","status":"publish","type":"post","link":"https:\/\/www.sysadmindayph.com\/blog\/the-getent-command\/","title":{"rendered":"The getent Command"},"content":{"rendered":"<p>For the UNIX side of things, we&#8217;ll try to feature one command a week that is commonly used in system\/user administration on a UNIX box. If anyone wants to contribute more, then we may do one command every two days or &#8216;Unix Command for the day&#8217;. Something like that.<\/p>\n<p>For today, it&#8217;s all about <em><strong>getent<\/strong>.<\/em><\/p>\n<p><strong><em>getent <\/em><\/strong>is short for <strong>Get Ent<\/strong>ries. The command suppose to get entries from an administrative <em>database<\/em>. This <em>database<\/em> can be passwd, group, hosts, ipnodes, services, protocols, ethers, network or netmasks.<\/p>\n<p>For each of these\u00a0 databases, getent uses the appropriate library routines described in getpwnam, getgrnam, gethostbyaddr, gethostbyname,\u00a0\u00a0 getipnodebyaddr, getipnodebyname, getservbyname,\u00a0 getprotobyname, ethers(3SOCKET), and getnetbyname(3SOCKET), respectively.<\/p>\n<p>getent prints out the database entries that match each of the supplied keys, one per line, int the format of the matching administrive file: Examples, passwd, group, hosts, etc&#8230;.<\/p>\n<p>Example: To check if a user dpusp or information about the TIT group:<\/p>\n<blockquote><p># getent<br \/>\nusage: getent database [ key &#8230; ]<br \/>\n# getent passwd dpusp<br \/>\ndpusp:x:7781:500::\/export\/home\/TIT\/dpusp:\/bin\/sh<br \/>\n#<br \/>\n# getent group TIT<br \/>\nTIT::500:adleo,gfish,rpesc,ftpoper,amkor<br \/>\n#<\/p><\/blockquote>\n<p>There.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the UNIX side of things, we&#8217;ll try to feature one command a week that is commonly used in system\/user administration on a UNIX box. If anyone wants to contribute more, then we may do &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,10,9,7,5,3],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-commands","category-linux","category-open-source","category-operating-system","category-solaris","category-unix"],"_links":{"self":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":0,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}