In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to view the current login users in Linux, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
1. View the currently logged in user
[wilsh@lcl ~] $whatis w w (1)-Show who is logged on and what they are doing [wilsh@lcl ~] $w 09:49:30 up 1 day, 17:19, 4 users, load average: 0.00,0.00 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty3-09:25 23:25 0.10s 0.08s-bash root pts/0 192.168.105.188 09:32 9:38 0.02s 0.02s-bash root pts/1 192.168.105.188 09:36 9:32 0.03s 0.02s-bash wilsh pts/2 192.168.105.188 09:41 0.00s 0.00s 0.00s w
2. Kick out the users who are currently online
A) pkill
[wilsh@lcl ~] $whatis pkill pkill [pgrep] (1)-look up or signal processes based on name and other attributes [wilsh@lcl ~] $pkill-KILL-u wilsh #-u is used to specify the user name [wilsh@lcl ~] $pkill-9-u wilsh #-KILL-9. [wilsh@lcl] $pkill-KILL-t pts/2 [wilsh@lcl ~] $pkill-KILL-t / dev/pts/2 # is incorrect. Because it is clearly stated in man page that you cannot drop out with / dev/ if you want to use the-t parameter. # after testing in centos6.7 kernel 3.10.28, it is found that writing a complete device name does not work (such as / dev/pts/2). This article was written in kernel 2.6.32. I just restarted the kernel that compiled 3.10.28 last night.
B) skill
[wilsh@lcl ~] $whatis skill skill (1)-send a signal or report process status [wilsh@lcl ~] $skill-9-t pts/2 [wilsh@lcl ~] $w 09:57:37 up 1 day, 17:28, 4 users, load average: 0.00,0.00 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty3-09:25 31:32 0.10s 0.08s-bash root pts/0 192.168.105.188 09:32 17:45 0.02s-bash root pts/1 192.168.105.188 09:36 17:39 0.01s 0.01s-bash wilsh pts/2 192.168.105.188 09:57 0.00s 0.00s 0.00s w [wilsh@lcl ~] $skill-9-u wilsh What is a Linux system Linux is a free-to-use and free-spread UNIX-like operating system Is a POSIX-based multi-user, multi-tasking, multi-threaded and multi-CPU operating system, using Linux to run major Unix tools, applications and network protocols.
The above is how to view the current login users in Linux. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.