如何在FreeBSD上打印用户和组的列表?


Answers:


21

用户和组存储在/ etc / group和/ etc / passwd中。打印:

awk -F":" '{print $1}' /etc/passwd
awk -F":" '{print $1}' /etc/group

2
在FreeBSD上,您会在开始时看到一些注释行。新增| grep -v“ ^#”从输出中删除那些。
blablabla 2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.