whoami(1) General Commands Manual whoami(1)NAME
whoami - Displays the user's name
SYNOPSIS
whoami
DESCRIPTION
The whoami command displays the username associated with your current ID.
Unlike who am i, this command tells you what your effective user ID is, and not who is logged on to your tty (it does not use
/var/adm/utmp).
If the current user ID is not in the password file, the message Intruder alert is displayed.
FILES
Contains usernames and IDs.
SEE ALSO
Commands: who(1)whoami(1)
Check Out this Related Man Page
whoami(1B) SunOS/BSD Compatibility Package Commands whoami(1B)NAME
whoami - display the effective current username
SYNOPSIS
/usr/ucb/whoami
DESCRIPTION
whoami displays the login name corresponding to the current effective user ID. If you have used su to temporarily adopt another user,
whoami will report the login name associated with that user ID. whoami gets its information from the geteuid and getpwuid library routines
(see getuid and getpwnam(3C), respectively).
FILES
/etc/passwd username data base
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO su(1M), who(1), getuid(2), getpwnam(3C), attributes(5)SunOS 5.10 14 Sep 1992 whoami(1B)
Ladies, Gents,
I am fairly new to this game but I am having trouble making the above command work.
If I login as root and go to terminal session "whoami" works.
If I login as admin open a terminal session and "su root" the "whoami" command comes up with " Not recognised".
Any ideas?
... (1 Reply)
Hello
I have a question about shell programming
So I recently found out that someone is secretly accessing my files due to my mistake. Of course, now, I changed all the permission so people cannot access my file(s) anymore.
However, I am a little bit mad about the fact and I'd like to find that... (1 Reply)
how can I use whoami on a script for ordinary user? it always says command not found. pls help
#!/bin/ksh
W='whoami'
DATE=`date "+%Y-%m-%d %H:%M:%S"`
echo " $DATE- by $W"
result
2011-03-29 09:46:16 - by
you wil noticed the by is blank...pls help..but in root, it works (1 Reply)
I was following a tutorial on installing Homebrew and I changed the ownership of /usr/local/ to me. Now McAfee Security won't start This is the exact line I typed:
sudo chown -R `whoami` /usr/local
Then I tried to fix it with:
sudo chown -R root /usr/local
I still can't start mcafee. It say... (7 Replies)
// AIX 6.1 TL8
Please advise on how to capture whoami log or the user and time info into a log file (i.e. /tmp/cmdcapture.log) whenever users are executing a certain command(s) so that I can keep the single log history (for all users) of who did what. The command(s) I need to monitor are a... (3 Replies)