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

Analysis on the use of who Command 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 introduces the analysis of the use of the who command in Linux, the content is very detailed, interested friends can refer to, hope to be helpful to you.

About who

Displays the users logged in to the system. Execute the who command to know which users are currently logged into the system, and executing the who command alone lists the login account, the terminal used, the login time, and where you logged in or which X monitor you are using.

Description

The who command prints information about all users who are currently logged in.

Who syntax

Who [OPTION]... [FILE] [am i]

Option

-a,-- all is the same as the option-b-d-- login-p-r-t-T-u.

-b,-- boot shows the last time the system booted.

-d,-- dead shows dead progress.

-H,-- heading prints a row of column headings.

-- ips prints the IP address instead of the hostname. Use-lookup to normalize based on the IP of the storage, if available, rather than the hostname of the storage.

-l,-- login printing system login process.

-- lookup attempts to normalize the hostname through DNS.

-m prints only information about the users and hosts associated with the standard input (the terminal that issued the command). This method conforms to the POSIX standard.

-p,-- process prints the active process generated by init.

-Q,-- count displays all logins, as well as the count of all logged-in users.

-r,-- runlevel prints the current runlevel.

-s,-- short prints only the name, line, and time fields, which is the default.

-t,-- time if information is available, print the time when the system clock was last changed.

-T,-w,-- mesg add a character indicating the status of the terminal: "+" if the terminal is writable, "-" if the terminal is not writable, or "?"

-u,-- users prints idle time and process ID for each user.

-- message is the same as-T.

-- writable is the same as-T.

-- help displays a help message and then exits.

-- version displays version information and then exits.

Notes

If a file is specified, who collects its information from that file. Otherwise, it is read from the default file location (usually / var/run/utmp).

If the parameter "am I" is specified, who assumes the-m option.

Who instance

Linuxidc@linuxidc:--$ who

Version view

Displays the user name, line, and time of all current login sessions. For example:

Who am i

Displays the same information, but only for terminal sessions that issue commands, such as:

Linuxmi pts/3 2018-12-02 08:52

Displays "all" information and the title above each column of data, such as:

Linuxidc@linuxidc:--$ who-aH

Name line time idle process number remark exit

The system guides the 2018-12-02 07:45 baby to be named http://www.bbqmw.net/qm_yeqm

Runlevel 5 2018-12-02 07:46

Linuxidc: 0 2018-12-02 07:47? 4569 (: 0)

This is the end of the analysis on the use of who commands in Linux. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.

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