Whoami
[Wikipedia|▼Menu]

whoami(フーアムアイ)は、Unix系オペレーティングシステムのほとんどに存在するコマンドである。Windows VistaWindows Server 2008にも搭載されている。これは "Who am I?(私は誰)" の語を連結したもので、実行したユーザの有効なuserid(ユーザ名)を表示する。
概要

UNIXのコマンドid -unと同じ効果である。Unix系オペレーティングシステムにおける$USERと似ているが、whoamiの出力結果はこれとは少し異なる。whoamiが出力するのはその時使っているユーザ名で、$USERが出力するのはログインに使用したユーザ名である。例えば、ユーザがJohnでログインし、次いでsuコマンドでrootになった場合、whoamiの出力はroot、echo $USERの出力はJohnとなる。suコマンドはデフォルトではログインシェルを呼び出さないためである。

GNU版のwhoamiも存在し、Richard MlynarikによってGNU Core Utilities (Coreutils) の一部として実装された。

このコマンドはまた、Windows 2000リソースキット[1] Windows XP SP2 Support Tools[2]にも含まれている。UNIXコマンドとは違いはオプションが多くあり、ログオンしているユーザーのユーザー、グループ、および権限の情報が表示できる。
例 (Coreutils)

rootとしてログインしている時、単にwhoamiとすると、以下の出力が得られる:# whoamiroot

ユーザbaldurとしてログインしている時なら以下のようになる:# whoamibaldur

--helpオプションを付けるとヘルプを表示する:# whoami --help

--versionオプションを付けるとバージョンを表示する:# whoami --versionwhoami (GNU coreutils) 6.10Copyright c 2008 [[Free Software Foundation]], Inc.License GPLv3+: GNU GPL version 3 or later <[http://gnu.org/licenses/gpl.html http://gnu.org/licenses/gpl.html]>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.Written by Richard Mlynarik.
例 (Windows)

Administratorとしてログオンしている時、単に whoamiとすると、以下の出力が得られる(ユーザ名の前はコンピュータ名またはドメイン名):C:\Users\Administrator>whoamiexample\Administrator

/privオプションを付けるとログオンしているユーザの特権を表示するC:\Users\Administrator>whoami /priv
脚注[脚注の使い方]^Windows 2000 Resource Kit Tool: Whoami.exe
^Windows XP Service Pack 2 Support Tools

関連項目.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:#f9f9f9;display:flow-root}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}ポータル FLOSS

logname

id

who

ユーザー識別子

外部リンク

whoami(1)
Linux man page (JM Project)

whoami(1B) man page (Solaris 10 Reference Manual) (英語)

whoami(1) man page(HP-UX リファレンス)

Microsoft TechNet Whoamiのページ
.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox{font-size:90%}.mw-parser-output .asbox-note{font-size:90%}.mw-parser-output .asbox .navbar{position:absolute;top:-0.90em;right:1em;display:none}

この項目は、ソフトウェアに関連した書きかけの項目です。この項目を加筆・訂正などしてくださる協力者を求めていますPJ:コンピュータ/P:コンピュータ)。
.mw-parser-output .hlist ul,.mw-parser-output .hlist ol{padding-left:0}.mw-parser-output .hlist li,.mw-parser-output .hlist dd,.mw-parser-output .hlist dt{margin-right:0;display:inline-block;white-space:nowrap}.mw-parser-output .hlist dt:after,.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{white-space:normal}.mw-parser-output .hlist li:after,.mw-parser-output .hlist dd:after{content:" ・\a0 ";font-weight:bold}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist-pipe dd:after,.mw-parser-output .hlist-pipe li:after{content:" |\a0 ";font-weight:normal}.mw-parser-output .hlist-hyphen dd:after,.mw-parser-output .hlist-hyphen li:after{content:" -\a0 ";font-weight:normal}.mw-parser-output .hlist-comma dd:after,.mw-parser-output .hlist-comma li:after{content:"、";font-weight:normal}.mw-parser-output .hlist-slash dd:after,.mw-parser-output .hlist-slash li:after{content:" /\a0 ";font-weight:normal}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")\a0 ";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)" ";white-space:nowrap}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)" "}.mw-parser-output .navbar{display:inline;font-size:75%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}.mw-parser-output .infobox .navbar{font-size:88%}.mw-parser-output .navbox .navbar{display:block;font-size:88%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}

表示

編集










Unixコマンド
ファイルとファイルシステム管理

cat

chattr(英語版)

chmod

chown

chgrp

cksum

cmp

cp

dd

du

df(英語版)

file

fsck

fuser(英語版)

ln

ls

lsof

mkdir

mount

mv

pax

pwd

rm

rmdir

size

split

tee

touch

type(英語版)

umask(英語版)

プロセス管理

at

bg

chroot

cron

fg

kill

killall

nice

pgrep

pidof

pkill

ps

pstree(英語版)

reboot

shutdown

time

top

ユーザ管理/環境

clear

env

exit

finger

history(英語版)

id

logname(英語版)

mesg

passwd

su

sudo

uptime

talk

tput(英語版)

uname

w

wall

who

whoami

write

テキスト処理

awk

banner

basename

comm(英語版)

csplit(英語版)


次ページ
記事の検索
おまかせリスト
▼オプションを表示
ブックマーク登録
mixiチェック!
Twitterに投稿
オプション/リンク一覧
話題のニュース
列車運行情報
暇つぶしWikipedia

Size:23 KB
出典: フリー百科事典『ウィキペディア(Wikipedia)
担当:undef