GETENT(1) Debian GNU/Linux GETENT(1)NAME
getent - get entries from administrative database
SYNOPSIS
getent database [key ...]
DESCRIPTION
The getent program gathers entries from the specified administrative database using the specified search keys. Where database is one of
passwd, group, hosts, services, protocols, or networks.
EXIT VALUES
The getent command exits with the following values:
0 Success
1 Unknown database
2 Key not found in database
3 Database does not support enumeration
AUTHOR
getent was written by Thorsten Kukuk for the GNU C Library.
This man page was written by Joel Klecker <espy@debian.org> for the Debian GNU/Linux system.
3rd Berkeley Distribution lenny GETENT(1)
Check Out this Related Man Page
GETENT(1) BSD General Commands Manual GETENT(1)NAME
getent -- get entries from administrative databases
SYNOPSIS
getent database [key ...]
getcap database [key ...]
DESCRIPTION
The getent program retrieves and displays entries from the administrative database specified by database, using the lookup order specified in
nsswitch.conf(5). The display format for a given database is as per the ``traditional'' file format for that database.
database may be one of:
Database Display format
disktab entry
ethers address name
gettytab entry
group group:passwd:gid:[member[,member]...]
hosts address name [alias ...]
netgroup (host,user,domain) [...]
networks name network [alias ...]
passwd user:passwd:uid:gid:gecos:home_dir:shell
printcap entry
protocols name protocol [alias ...]
rpc name number [alias ...]
services name port/protocol [alias ...]
shells /path/to/shell
If one or more key arguments are provided, they will be looked up in database using the appropriate function. For example, passwd supports a
numeric UID or user name; hosts supports an IPv4 address, IPv6 address, or host name; and services supports a service name, service name/pro-
tocol name, numeric port, or numeric port/protocol name.
If no key is provided and database supports enumeration, all entries for database will be retrieved using the appropriate enumeration func-
tion and printed.
For cgetcap(3) style databases (disktab, printcap) specifying a key, lists the entry for that key, and specifying more arguments after the
key are used as fields in that key, and only the values of the keys are returned. For boolean keys true is returned if the key is found. If
a key is not found, then false is always returned.
DIAGNOSTICS
getent exits 0 on success, 1 if there was an error in the command syntax, 2 if one of the specified key names was not found in database, or 3
if there is no support for enumeration on database.
SEE ALSO cgetcap(3), disktab(5), ethers(5), gettytab(5), group(5), hosts(5), networks(5), nsswitch.conf(5), passwd(5), printcap(5), protocols(5),
rpc(5), services(5), shells(5)HISTORY
A getent command appeared in NetBSD 3.0. It was based on the command of the same name in Solaris and Linux.
BSD October 11, 2011 BSD
Hi everybody,
The problem is quite simple, I want to change my default shell which is /bin/csh to /bin/bash. I have looked online for solutions to my problem, but to no avail.
I have tried chsh, but it tells me this:
chsh: can only change local entries; use ypchsh instead.
I use ypchsh,... (7 Replies)
Hello, thanks in advance for any help!
We use LDAP for our unix boxes
When I run getent passwd on solaris 10, it only returns some of the ldap entries, not all. Aprox 300 of 4000. When i run the same command on linux or solaris 9, it comes back correct.
my nsswitch file is good.
I ran a... (6 Replies)
korn shell script on Solaris
getent hosts <hostname> returns
IP FQDN
But I just want the output to be like this
<hostname> IP
things I have tried so far
getent hosts <hostname> |awk '{print $2,$1}'
using awk and substr
getent hosts <hostname> |nawk '{print substr($2,1,5)}'
... (1 Reply)
I'm typing "id <user's id>" and its returning a different UID that what is defined in our administration system. Where does id / getent query and where is it configured to query? I'm guessing it queries the local /etc/passwd file first, and then if it doesn't find anything it would query LDAP... (2 Replies)