Linuxユーザー確認
ログインユーザー
who
特定ユーザーの詳細
cat /etc/passwd |grep tomcat
tomcat:x :1002:1002::/opt/tomcat:/bin/false
|ユーザー名|パスワード(x表示)|ユーザーID|グループID|任意コメント|ホームディレクトリ|シェルの場所|
|----|----|----|----|----|----|----|----|----|----|----|----|----|
|tomcat|x|1002|1002||/opt/tomcat|/bin/false|
ユーザー 詳細一覧
cat /etc/passwd
ユーザー名 一覧
cut -d: -f1 /etc/passwd
cutコマンド
オプション | 略 | 備考 |
---|---|---|
-d | --delimiter | 項目名を区切る際に、区切り文字を使用。-fオプションと組み合わせて使用する。 |
-f | --fields | 必要な項目を項目数で指定する |