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

How to use who Command in Linux system

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

Share

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

This article will explain in detail how to use the who command in the Linux system. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

In Linux systems, the who command applies to commands that print all current online user information.

Who syntax

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

Option

-a,-all is the same as using 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 that indicates the status of the terminal: "+" if the terminal is writable, "-" if the terminal is not writable, or "?"-u,-users prints the idle time and process ID of 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

1linuxidcmistlinuxidcplugs $who

Version view

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

1who am i

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

1linuxmi pts/3 2018-12-02 08:52

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

12345678910 who-aH name line time idle process number remarks exit system boot 2018-12-02 07:45 run level 5 2018-12-02 07:46linuxidc?: 0 2018-12-02 07:47? 4569 (: 0)

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

On how to use who commands in the Linux system to share here, I hope the above content can be of some help to you, can 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

Development

Wechat

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

12
Report