Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

See how to use the serial who command for processes in linux

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the linux process view serial who command how to use, the article is very detailed, has a certain reference value, interested friends must read it!

The common syntax formats of the who command are as follows:

Who [imqsuwHT] [--count] [--idle] [--heading] [--help] [--message] [--mesg] [--version] [--writable] [file] [am I]

All options are optional, which means you can use the who command alone.

When no options are used, the who command displays the following three items:

◆ login name: login user name

◆ terminal line: using end Devic

◆ login time: the time you logged in to the system.

If two non-optional parameters are given, the who command will only show the user name, login terminal, and login time from which the who program is running. Usually these two parameters are "am I", that is, the command format is "who am i".

The common parameters of the who command are described below.

-m does the same thing as "who am i", showing the user name under which the program is running.

-qmam copyright account shows only the user's login account and the number of users logged in, and this option takes precedence over any other option.

-s ignore. It is mainly used for compatibility with other versions of who commands.

After the login time, iMetrum talk talk shows the time that the user has operated the system since *, which is often called "daze" time.

-Hmam Mustang shows a row of headings.

User network address

-wmam talk meso talk talk, talk talk meso talk, talk talk messagelight talk about writable, like the-s option, a character is displayed after the login account to indicate the user's information status:

+: allow to write information

-: writing information is not allowed

The terminal device could not be found.

-- help displays help information on standard output.

-- version displays version information on standard output.

Here are some basic uses of the who command.

If you need to see which users are on the system, you can use the who command directly.

Check the status of users logged in to the system

$who

Root tty1 Mar 17 13:49

Foxy tty2 Mar 17 13:49

Root tty3 Mar 17 13:49

Bbs ttyp0 Mar 17 13:49 (river.net)

As you can see, the system now has a total of four users. The * column is the account number of the logged-in user; the second column is the terminal used to log in; the third column is the login time; and the fourth column is the network address where the user is logged in. Here is the domain name.

In general, this gives you an overview of the logged-in user. But sometimes the above display is not so intuitive, because there is no title description, it is not easy to understand, then you need to use the-H option.

To view the details of the logged-in user, type:

$who-uH

The display is as follows:

USER LINE LOGIN-TIME IDLE FROM

Root tty1 Mar 17 13:49.

Foxy tty2 Mar 17 13:49 00:01

Root tty3 Mar 17 13:49 00:01

Bbs ttyp0 Mar 17 13:49 00:01 (river.net)

It's clear at a glance. The-u option specifies that the user's idle time is displayed, so you can see that there is an extra IDLE. The IDLE entry for * root users is a ".", which means that the user is still active in the first second, while all other users have a time after that, which is called idle time.

* take a look at the results of using the "who am i" format command:

233.river.net!root tty1 Mar 17 13:49

You can see that only the user running the who command is shown, of course, there is no free time at this time. The who command is very simple to use and can accurately grasp the situation of the user, so it is widely used.

The above is all the contents of the article "process View Serial who Command in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report