Linux View Online Users __linux

Source: Internet
Author: User

Linux is a multiuser system that, once connected to a network, can serve multiple logged-in users at the same time. System administrators can keep abreast of the users in the system and what they are doing.

to view the actions of a user
If the system administrator wants to know the behavior of the user at a certain moment, just enter the command W, enter the following command in the shell terminal:
tux@tux-desktop:~$ W

21:13:14 up 7:08, 2 users, load average:0.22, 0.32, 0.20
USER TTY from login@ IDLE jcpu pcpu WHAT
Tux tty7:0    14:05? 37:55 0.33s X-session-manag
Tux pts/1:0.0 21:13 0.00s 0.13s 0.00s W

You can see the Execute w command and display the results.
Meaning of command information
The information shown above is indicated as follows:
The first line displays the summary information of the system, which indicates the current time of the system, the system running time, the total number of users in the login and the system average load information. For several of these forces, the meaning of the data is:
21:13:14 indicates that the time of execution W is at 9:13 in the evening.
7:08 indicates that the system runs 7 hours and 8 minutes.
2 users indicate that the total number of user current system login is 2.
The load average, along with the numbers that follow, indicates how much the system has been loaded in the past 1, 5, 10 minutes, and the smaller the number, the lighter the system load.
form the second line, a total of 8 columns showing what each user is doing and the system information that the user occupies.
User: Displays the username of the login account. Users repeat the login, the account will also appear repeatedly.
TTY: The terminal used by the user to log in.
From: Shows where users are logged on to the system.
login@: The meaning of login at, indicating the time when the login was entered into the system.
IDLE: User idle time, from the last task after the user, when the meeting.
JCPU: A terminal code to differentiate, indicating that in the touch of time, all related to the terminal process tasks of CPU time.
PCPU: Refers to the CPU time that is consumed by the task execution of the what domain.
WHAT: Represents the currently executing task.

View a user
When you log in to a lot of users of the system, you can add a user name after W, and you'll see how the user performs the task.
tux@tux-desktop:~$ W Tux
21:19:01 up 7:14, 2 users, load average:0.25, 0.21, 0.18
USER TTY from login@ IDLE jcpu pcpu WHAT
Tux tty7:0    14:05? 38:05 0.33s X-session-manag
Tux pts/1:0.0 21:13 0.00s 0.13s 0.00s w Tux

By default, all of the above information is displayed, and you can use only the relevant options if you are concerned about only one aspect.

2. View User Login history last
Oracle pts/0 Mon June 1 15:18 still logged in
Oracle pts/0 Tue June 25 17:39-18:04 (00:25)
Oracle pts/0 Tue June 25 17:13-17:14 (00:00)
Oracle PTS/1 Tue June 25 15:05-15:07 (00:01)
Oracle pts/0 Tue June 25 11:20-15:12 (03:51)

3. Kick out the user

Pkill-kill-t pts/0  #pts/0 user terminal number seen for W instruction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.