LoginSignup
6
7

More than 5 years have passed since last update.

Linuxのユーザーとかグループとかの確認コマンド

Last updated at Posted at 2015-08-11

忘れがちなので。

ユーザー一覧

$ cat /etc/passwd
# LDAPアカウントを含むユーザー一覧の場合、getentコマンドを利用
$ getent passwd

グループ一覧

$ cat /etc/group
# 同じく
$ getent group

ログインユーザー名とプロセス

$ w
 01:50:21 up  1:02,  1 user,  load average: 0.00, 0.01, 0.05
USER    TTY     FROM            LOGIN@  IDLE    JCPU    PCPU    WHAT
hoge    pts/0   xxxx.yyy.zzz    01:19   5.00s   0.01s   0.00s   -bash

ログインユーザーの所属グループ

$ groups
wheel apache tomcat
6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7