WHOAMI(1) COMMAND REFERENCE WHOAMI(1)
NAME
whoami - print effective current user ID
SYNOPSIS
whoami
DESCRIPTION
Whoami prints the effective user ID which is running the
current process. This is different from who am i, which
prints the name of the person logged in on the tty.
EXAMPLES
The following shell script fragment prevents the user ID
root from executing the command:
#!/bin/sh
if test 'root' = "`whoami`"
then
echo "This shell script may not be run by 'root'."
exit 1
fi
...
FILES
/etc/passwd Name data base.
RETURN VALUE
[NO_ERRS] Command completed without error.
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
CAVEATS
The user ID returned corresponds to who you are at that
point in time. So if you have used su to substitute another
username, that name is returned.
SEE ALSO
who(1n), su(1).
Printed 10/17/86 1
%%index%%
na:72,76;
sy:148,106;
de:254,350;
ex:604,357;
fi:961,101;
rv:1062,244;
ca:1306,229;
se:1535,99;
%%index%%000000000129