In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to view linux users, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
When using the Linux system, you often need to check the user information. In addition to the cat / etc/passwd file, there are many commands that can view the system user information directly.
Here are some common ways to view users on Linux systems:
Id command
Function: print the user and group information of the specified user.
Syntax: id [options]... [user name]
Description: if the user name is omitted, print the user and group information of the current user.
Whois command
Function: find and display user information.
Syntax: whois [options]... The object...
Description: the whois instruction will find and display the user-related information of the specified account, because it is to look up in the WHOIS database, so the account name must be registered above to be found, and the name has no case difference. To use the whois instruction, you need to install the whois package first.
Whoami command
Function: displays the user name associated with the currently valid user ID.
Syntax: whoami [options]...
Description: same as id-un.
Parameters:
-- help displays this help and exits
-- version displays version information and returns
Id and whoami commands for Linux
Who command
Function: displays the information of currently logged-in users.
Syntax: who [options]... [file | Parameter 1, Parameter 2]
Note: execute this command to know which users are currently logged into the system. Executing the who command alone will list the login account, the terminal used, the login time, and where you are logged in or which X monitor you are using.
Parameters:
Combination of options-a,-- all equals-b-d-- login-p-r-t-T-u
-b,-- boot last time the system started
-d,-- dead shows dead processes
-H,-- title column of the heading output header
-lmine Meltel login displays the login process of the system
-- lookup attempts to check the hostname through DNS
-m only faces hosts and users that interact directly with standard input
-p,-- process displays active processes derived from init processes
-Q,-- count lists the login names and number of all logged-in users
-r,-- runlevel shows the current runlevel
-s,-- short displays only the name, line, and time (default)
-T,-w,-- mesg with +,-or? Label the status of user messages
-u,-- users lists users who have logged in
-- message equals-T
-- writable equals-T
-- help displays this help and exits
-- version displays version information and returns
Who command for Linux
W command
Function: display the user information currently logged in to the system.
Syntax: W [- fhlsuV] [user name]
Description: by executing this instruction, you can know who are currently logged into the system and the programs they are executing. Executing the w instruction alone displays all users, or you can specify a user name to display only information about a user.
Parameters:
-f turns on or off showing where the user logs in to the system.
-h does not display the title information column of each field.
-l uses a detailed format list, which is the default value.
-s uses a concise format list and does not show the login time of the user, the CPU time spent by the terminal phase jobs and programs.
-u ignores the name of the executing program and the information that the program takes CPU time.
-V displays version information.
W command of Linux
Finger command
The function of the finger command is to query the user's information, which usually displays the user name, home directory, stagnation time, login time, login shell and other information of a user in the system. If you want to query user information on a remote machine, you need to follow the user name with "@ hostname" in the format of [username @ hostname], but the network host you want to query needs to run the finger daemon.
The general format of the command is:
Finger [option] [user] [user @ host]
The options in the command have the following meanings:
-s displays the user's registration name, actual name, terminal name, write status, stagnation time, login time and other information.
In addition to the information displayed with the-s option, it also displays information such as the user's home directory, login shell, mail status, and the contents of .plan, .project, and .forward files under the user's home directory.
-p is the same as the-l option except that the .plan file and .project file are not displayed.
Finger command for Linux
Vlock command
Function: lock the virtual terminal.
Syntax: vlock [- achv]
Description: the execution of vlock instructions can lock the virtual terminal and prevent others from using it.
Parameters:
-an or-- all locks all terminal phase jobs, and if you use this parameter in a full-screen terminal, the function of switching terminals with the keyboard will be turned off as well.
-c or-- current locks the current terminal phase job, which is the default value.
-h or-- help online help.
-v or-- version displays version information.
Vlock command under Linux
These are the common ways to view users on Linux, and you don't have to look up / etc/passwd files directly anymore.
The above is how linux views all the content of users. 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!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.