Administrative Databases in Linux

Some files in /etc directory are Administrative databases, they are basically important text files called databases

  • passwd – can be used to confirm usernames, userids, home directories and full names of your users
  • group – all the information about Unix groups known to your system
  • services – all the Unix services configured on your system
  • networks – networking information – what networks your system belongs to
  • protocols – everything your system knows about network protocols

getent is a Linux command that helps the user to get the entries in these files

getent database [key ...]

Examples

$ getent passwd mimigonz

mimigonz:x:52060:2147483646:Miguel Gonzalez:/home/mimigonz:/bin/bash
$ getent passwd

rcamaril:x:51035:2147483646:Roberto Camarillo:/home/rcamaril:/bin/bash
mimigonz:x:52060:2147483646:Miguel Gonzalez:/home/mimigonz:/bin/bash
abkhalid:x:52600:2147483646:Abdul Khalid:/home/abkhalid:/bin/bash
opc:x:1000:1000:Oracle Public Cloud User:/home/opc:/bin/bash
hostmetrics:x:992:99::/home/hostmetrics:/bin/false
oracle-cloud-agent:x:997:994:Oracle Cloud Agent Service User:/var/lib/oracle-cloud-agent:/usr/sbin/nologin