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
angryTomOriginal
2019-11-05 15:00:2514816browse

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

. 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"

View the total number of system users:

cat /etc/passwd | wc -l

will return the total number of users.

View current users:

whoami

View current system online users:

w

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!

Statement:
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