.\" Copyright (c) 2011, Mark R. Bannister .\" Copyright (c) 2015, Robin H. Johnson .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH GETENT 1 2020\-12\-21 Linux "User Commands" .SH 名前 getent \- 名前サービス切り替えライブラリからエントリーを取得する .SH 書式 \fBgetent\ [\fP\fIoption\fP\fB]...\ \fP\fIdatabase\fP\fB\ \fP\fIkey\fP\fB...\fP .SH 説明 \fBgetent\fP コマンドは、 名前サービス切り替えライブラリでサポートされているデータベースのエントリーを表示する。 名前サービス切り替えライブラリの設定は \fI/etc/nsswitch.conf\fP で行う。 一つ以上の \fIkey\fP 引数が指定されると、 指定されたキーにマッチするエントリーだけが表示される。 \fIkey\fP が指定されなかった場合、 すべてのエントリーが表示される (データベースで列挙 (enumeration) がサポートされていない場合を除く)。 .PP \fIdatabase\fP には GNU C ライブラリでサポートされているデータベースのいずれかを指定できる。 以下にそのリストを示す。 .RS 3 .TP 10 \fBahosts\fP \fIkey\fP が指定されなかった場合、 \fBsethostent\fP(3), \fBgethostent\fP(3), \fBendhostent\fP(3) を使用して hosts データベースを列挙する。 これは \fBhosts\fP を使うのと全く同じである。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP についてアドレスファミリー \fBAF_UNSPEC\fP で \fBgetaddrinfo\fP(3) を呼び出し、 返された各々のソケットアドレス構造体を列挙する。 .TP \fBahostsv4\fP \fBahosts\fP を同じだが、 アドレスファミリーとして \fBAF_INET\fP を使用する。 .TP \fBahostsv6\fP \fBahosts\fP を同じだが、 アドレスファミリーとして \fBAF_INET6\fP を使用する。 この場合の \fBgetaddrinfo\fP(3) の呼び出しでは \fBAI_V4MAPPED\fP も指定される。 .TP \fBaliases\fP \fIkey\fP が指定されなかった場合、 \fBsetaliasent\fP(3), \fBgetaliasent\fP(3), \fBendaliasent\fP(3) を使用して aliases データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について\fBgetaliasbyname\fP(3) を呼び出し、 結果を表示する。 .TP \fBethers\fP \fIkey\fP 引数が一つ以上指定された場合、 結果が得られるまで、 それぞれの \fIkey\fP について \fBether_aton\fP(3) と \fBether_hostton\fP(3) を順に呼び出し、 結果を表示する。 \fBethers\fP では列挙はサポートされていない。 したがって、 \fIkey\fP は指定しなければならない。 .TP \fBgroup\fP \fIkey\fP が指定されなかった場合、 \fBsetgrent\fP(3), \fBgetgrent\fP(3), \fBendgrent\fP(3) を使用して group データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について、 数値であれば \fBgetgrgid\fP(3) を、 数値以外であれば \fBgetgrnam\fP(3) を呼び出し、 結果を表示する。 .TP \fBgshadow\fP \fIkey\fP が指定されなかった場合、 \fBsetsgent\fP(3), \fBgetsgent\fP(3), \fBendsgent\fP(3) を使用して gshadow データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について \fBgetsgnam\fP(3) を呼び出し、 結果を表示する。 .TP \fBhosts\fP \fIkey\fP が指定されなかった場合、 \fBsethostent\fP(3), \fBgethostent\fP(3), \fBendhostent\fP(3) を使用して hosts データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について \fBgethostbyaddr\fP(3) か \fBgethostbyname2\fP(3) を呼び出し、 結果を表示する。 \fBgethostbyaddr\fP(3) か \fBgethostbyname2\fP(3) のどちらを呼び出すかは、\fBinet_pton\fP(3) の呼び出しで、 \fIkey\fP が IPv6 や IPv4 アドレスか、 そうでないか、 判定され、その結果によって決まる。 .TP \fBinitgroups\fP \fIkey\fP 引数が一つ以上指定された場合、 結果が得られるまで、 それぞれの \fIkey\fP について \fBgetgrouplist\fP(3) を呼び出し、 結果を表示する。 \fBinitgroups\fP では列挙はサポートされていない。 したがって、 \fIkey\fP は指定しなければならない。 .TP \fBnetgroup\fP 1 個の \fIkey\fP を指定すると、 その \fIkey\fP を \fBsetnetgrent\fP(3) に渡し、 \fBgetnetgrent\fP(3) を使って結果の 3 つ組の文字列 (\fIhostname\fP, \fIusername\fP, \fIdomainname\fP) を表示する。 代わりに、 3 個の \fIkey\fP を指定することもできる。 3 個の \fIkey\fP は \fIhostname\fP, \fIusername\fP, \fIdomainname\fP と解釈され、 \fBinnetgr\fP(3) を使って対応する netgroup があるか照合される。 \fBnetgroup\fP では列挙はサポートされていない。 したがって、 1 個か 3 個のいずれかの \fIkey\fP を指定しなければならない。 .TP \fBnetworks\fP \fIkey\fP が指定されなかった場合、 \fBsetnetent\fP(3), \fBgetnetent\fP(3), \fBendnetent\fP(3) を使用して networks データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について、 数値であれば \fBgetnetbyaddr\fP(3) を、 数値以外であれば \fBgetnetbyname\fP(3) を呼び出し、 結果を表示する。 .TP \fBpasswd\fP \fIkey\fP が指定されなかった場合、 \fBsetpwent\fP(3), \fBgetpwent\fP(3), \fBendpwent\fP(3) を使用して passwd データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について、 数値であれば \fBgetpwgid\fP(3) を、 数値以外であれば \fBgetpwnam\fP(3) を呼び出し、 結果を表示する。 .TP \fBprotocols\fP \fIkey\fP が指定されなかった場合、 \fBsetprotoent\fP(3), \fBgetprotoent\fP(3), \fBendprotoent\fP(3) を使用して protocols データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について、 数値であれば \fBgetprotobynumber\fP(3) を、 数値以外であれば \fBgetprotobyname\fP(3) を呼び出し、 結果を表示する。 .TP \fBrpc\fP \fIkey\fP が指定されなかった場合、 \fBsetrpcent\fP(3), \fBgetrpcent\fP(3), \fBendrpcent\fP(3) を使用して rpc データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について、 数値であれば \fBgetrpcbynumber\fP(3) を、 数値以外であれば \fBgetrpcbyname\fP(3) を呼び出し、 結果を表示する。 .TP \fBservices\fP \fIkey\fP が指定されなかった場合、 \fBsetservent\fP(3), \fBgetservent\fP(3), \fBendservent\fP(3) を使用して services データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について、 数値であれば \fBgetservbynumber\fP(3) を、 数値以外であれば \fBgetservbyname\fP(3) を呼び出し、 結果を表示する。 .TP \fBshadow\fP \fIkey\fP が指定されなかった場合、 \fBsetspent\fP(3), \fBgetspent\fP(3), \fBendspent\fP(3) を使用して shadow データベースを列挙する。 \fIkey\fP 引数が一つ以上指定された場合は、 それぞれの \fIkey\fP について \fBgetspnam\fP(3) を呼び出し、 結果を表示する。 .RE .SH オプション .TP \fB\-s\ \fP\fIservice\fP, \fB\-\-service\ \fP\fIservice\fP .\" commit 9d0881aa76b399e6a025c5cf44bebe2ae0efa8af (glibc) Override all databases with the specified service. (Since glibc 2.2.5.) .TP \fB\-s\ \fP\fIdatabase\fP\fB:\fP\fIservice\fP, \fB\-\-service\ \fP\fIdatabase\fP\fB:\fP\fIservice\fP .\" commit b4f6f4be85d32b9c03361c38376e36f08100e3e8 (glibc) Override only specified databases with the specified service. The option may be used multiple times, but only the last service for each database will be used. (Since glibc 2.4.) .TP \fB\-i\fP, \fB\-\-no\-idn\fP .\" commit a160f8d808cf8020b13bd0ef4a9eaf3c11f964ad (glibc) Disables IDN encoding in lookups for \fBahosts\fP/\fBgetaddrinfo\fP(3) (Since glibc\-2.13.) .TP \fB\-?\fP, \fB\-\-help\fP Print a usage summary and exit. .TP \fB\-\-usage\fP Print a short usage summary and exit. .TP \fB\-V\fP, \fB\-\-version\fP Print the version number, license, and disclaimer of warranty for \fBgetent\fP. .SH 終了ステータス \fBgetent\fP は以下のいずれかの終了ステータスを返す。 .RS 3 .TP \fB0\fP コマンドが正常に完了した。 .TP \fB1\fP 引数が不足しているか、 知らない \fIdatabase\fP が指定された。 .TP \fB2\fP 指定された \fIkey\fP が \fIdatabase\fP で見つからなかった。 .TP \fB3\fP この \fIdatabase\fP では列挙はサポートされていない。 .RE .SH 関連項目 \fBnsswitch.conf\fP(5) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。