Linux User Commands

From Schmid.wiki
Jump to: navigation, search

Contents

uid's

Get uid for a user

id USERNAME

Information about user-related commands:

info coreutils 'user information'

User info

'finger' is used for getting information about users. List real names of all users logged on:

$ for x in `users`;do finger $x|grep Name|sed -r 's/^.*Name: (.*)$/\1/';done
Jungle Ras
Peder Dingo
(some users may be listed more than once)

Who is logged on?

Watch logged on users:

$ watch -d -n 1 'who -u'

kick user 'schmid':

# ps au|egrep "^(U|schmid)"
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
schmid   14366  0.0  1.0  2268 1292 tty3     S    19:32   0:00 -bash
schmid   14653  1.1  2.4  6336 3104 tty3     S    19:43   0:02 vim user_management.txt
# kill -9 14366
            |__ (careful not to kill your own bash!!! :)

Messaging

Message 'huba' to all users:

$ wall huba
Personal tools