统计/etc/passwd文件中各用户所使用的shell类型及出现次数
awk -F: ‘BEGIN{printf"%-15s\t%s\n","ShellType","Count"}{shellType[$NF]++}END{for(i in shellType)printf"%-15s\t%d\n",i,shellType[i]}‘ /etc/passwd
时间: 2024-10-09 05:33:39
统计/etc/passwd文件中各用户所使用的shell类型及出现次数
awk -F: ‘BEGIN{printf"%-15s\t%s\n","ShellType","Count"}{shellType[$NF]++}END{for(i in shellType)printf"%-15s\t%d\n",i,shellType[i]}‘ /etc/passwd