Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the w command of linux to display logged in users

Shulou Source: shulou.com Published: 2022-06-02 18:07:02 09月22日 Update

Do not know how to use linux's w command to display logged-in users? In fact, it is not difficult to solve this problem. Let the editor take you to learn how to solve it. I hope you will gain a lot after reading this article.

The W command is used to display a list of users who have logged in to the system and to display the instructions that the user is executing. Execute this command to know who are currently logged in to the system and the programs they are executing. Executing the w command alone displays all users, or you can specify a user name to display only information about a user.

Syntax format: W [parameters]

Commonly used parameters: coach

-h/--no-header does not print header information-u/--no-current ignores username when displaying current process and cpu time-s/--short uses short output format-f/--from shows where the user logs in-o/--old-style old output-i/--ip-addr displays IP address instead of hostname (if possible)-help displays this help and exits-V/--version displays version information

Reference example

Displays the user information that is currently logged in to the system:

[root@linuxcool ~] # w

Do not print header information:

[root@linuxcool] # w-h

Show where the user logged in:

[root@linuxcool] # w-f

Use the short output format:

[root@linuxcool] # w-s Thank you for reading this article carefully. I hope the editor will share and use the w command of linux to show the content of logged-in users. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

Tags: User command information login format system output parameter current article question study help host content at the same time name address instance commonly used Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Xiaomi Huawei Linux Microsoft