[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes commands that print user-related information: logins, groups, and so forth.
20.1 id
: Print real and effective uid and gidPrint real and effective uid and gid. 20.2 logname
: Print current login namePrint current login name. 20.3 whoami
: Print effective user idPrint effective user id. 20.4 groups
: Print group names a user is inPrint group names a user is in. 20.5 users
: Print login names of users currently logged inPrint login names of users currently logged in. 20.6 who
: Print who is currently logged inPrint who is currently logged in.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
id
: Print real and effective uid and gid
id
prints information about the given user, or the process
running it if no user is specified. Synopsis:
id [option]... [username] |
By default, it prints the real user id, real group id, effective user id if different from the real user id, effective group id if different from the real group id, and supplemental group ids.
Each of these numeric values is preceded by an identifying string and followed by the corresponding user or group name in parentheses.
The options cause id
to print only part of the above information.
Also see 2. Common options.
-u
, -g
, or -G
.
-u
, -g
, or -G
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
logname
: Print current login name
logname
prints the calling user's name, as found in the file
`/etc/utmp', and exits with a status of 0. If there is no
`/etc/utmp' entry for the calling process, logname
prints
an error message and exits with a status of 1.
The only options are `--help' and `--version'. See section 2. Common options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
whoami
: Print effective user id
whoami
prints the user name associated with the current
effective user id. It is equivalent to the command `id -un'.
The only options are `--help' and `--version'. See section 2. Common options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
groups
: Print group names a user is in
groups
prints the names of the primary and any supplementary
groups for each given username, or the current process if no names
are given. If names are given, the name of each user is printed before
the list of that user's groups. Synopsis:
groups [username]... |
The group lists are equivalent to the output of the command `id -Gn'.
The only options are `--help' and `--version'. See section 2. Common options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
users
: Print login names of users currently logged in
users
prints on a single line a blank-separated list of user
names of users currently logged in to the current host. Each user name
corresponds to a login session, so if a user has more than one login
session, that user's name will appear the same number of times in the
output. Synopsis:
users [file] |
With no file argument, users
extracts its information from
the file `/etc/utmp'. If a file argument is given, users
uses that file instead. A common choice is `/etc/wtmp'.
The only options are `--help' and `--version'. See section 2. Common options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
who
: Print who is currently logged in
who
prints information about users who are currently logged on.
Synopsis:
|
If given no non-option arguments, who
prints the following
information for each user currently logged on: login name, terminal
line, login time, and remote hostname or X display.
If given one non-option argument, who
uses that instead of
`/etc/utmp' as the name of the file containing the record of
users logged on. `/etc/wtmp' is commonly given as an argument
to who
to look at who has previously logged on.
If given two non-option arguments, who
prints only the entry
for the user running it (determined from its standard input), preceded
by the hostname. Traditionally, the two arguments given are `am
i', as in `who am i'.
The program accepts the following options. Also see 2. Common options.
who
.
`+' allowing |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |