Home > Operation and Maintenance > Linux Operation and Maintenance > Linux checks which users are on the system

Linux checks which users are on the system

angryTom
Release: 2019-11-05 15:00:25
Original
14819 people have browsed it

Linux checks which users are on the system

linux Check which users are in the system

All user information in the Linux system is stored in the /etc/passwd file , we can view the user by printing

cat /etc/passwd
Copy after login

. Each line represents one user. The last field of each line is the user's shell execution environment. Nologin means that the system cannot be logged in.

Linux checks which users are on the system
View users who can log in to the system

cat /etc/passwd | grep -v "nologin"
Copy after login

View the total number of system users:

cat /etc/passwd | wc -l
Copy after login

will return the total number of users.

View current users:

whoami
Copy after login

View current system online users:

w
Copy after login

Recommended: [Linux video tutorial

The above is the detailed content of Linux checks which users are on the system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template