Linux系统列出所有用户
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
在Linux系统上,你可以使用以下命令来查看有多少个用户并列出所有用户:
1、使用 cat /etc/passwd | cut -d: -f1
命令:
cat /etc/passwd | cut -d: -f1
这个命令会读取 /etc/passwd
文件,并通过 cut
命令提取每行中的第一个字段(即用户名),从而列出所有用户。
2、使用 awk -F: '{ print $1 }' /etc/passwd
命令:
awk -F: '{ print $1 }' /etc/passwd
这个命令使用 awk
命令来以 :
作为分隔符,提取每行的第一个字段,并输出所有用户的用户名。3
3、使用 getent passwd | cut -d: -f1
命令:
getent passwd | cut -d: -f1
这个命令使用 getent
命令来获取用户数据库中的所有用户信息,并通过 cut
命令提取每行的第一个字段(即用户名)。




A beautiful web dashboard for Linux
最近提交(Master分支:7 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
更多推荐
所有评论(0)