Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the whoami command of linux to print the currently logged in user

Shulou Source: shulou.com Published: 2022-06-02 12:43:36 11月28日 Update

Editor to share with you the use of linux whoami command to print the current login users, I believe that most people do not know much, so share this article for you to learn, I hope you will learn a lot after reading this article, let's go to learn the method!

The whoami command prints the user name associated with the currently valid user ID; this tool can be used to obtain the user name and group information of the current user (access token) on the local system, as well as the corresponding security identifier (SID), declaration, permissions of the current user on the local system, and login identifier (login ID).

The whoami command displays its own user name, and this instruction is equivalent to executing the "id-un" directive.

Syntax format: whoami [parameters]

Common parameters:

-- help online help-- version displays version information

Reference example

Query the user name of the current login:

[root@linuxcool ~] # whoami root above use the whoami command of linux to print all the content of the currently logged-in user, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Users logins commands user names learning information content parameters instructions identifiers identifiers systems help valid security less tokens names online help most Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB macOS Shulou Tech Info Huawei