cut -d: -f2 /etc/passwd
存放加密的口令 如為X表示被加密 /etc/shadow
cut -d: -f3 /etc/passwd
用戶標識號,每個用戶的uid是唯一的,rott = 0 ,一般用戶從500開始 ,1-499是系統的標准帳戶
cut -d: -f4 /etc/passwd 組標識號,系統內部用它來標識用戶所屬的組
3.4 個字段為數字
cut -d: -f5 /etc/passwd 注解性描述,用戶的全稱
cut -d: -f6 /etc/passwd 宿主目錄$HOME
cut -d: -f7 /etc/passwd shell $SHELL
共7個字段
type commandname 查看执行命令的类型 它是用来区分某个命令到底是由shell自带的,还是由shell外部的独立二进制文件提供的。如果一个命令是外部命令,那么使用-p参数,会显示该命令的路径,相当于which命令。
1) type dir or type -p dir
dir is hsahed(/usr/bin/dir)
2) type cd
cd is a shell buildin 系统会提示,cd是shell的自带命令(build-in)。
存放加密的口令 如為X表示被加密 /etc/shadow
cut -d: -f3 /etc/passwd
用戶標識號,每個用戶的uid是唯一的,rott = 0 ,一般用戶從500開始 ,1-499是系統的標准帳戶
cut -d: -f4 /etc/passwd 組標識號,系統內部用它來標識用戶所屬的組
3.4 個字段為數字
cut -d: -f5 /etc/passwd 注解性描述,用戶的全稱
cut -d: -f6 /etc/passwd 宿主目錄$HOME
cut -d: -f7 /etc/passwd shell $SHELL
共7個字段
type commandname 查看执行命令的类型 它是用来区分某个命令到底是由shell自带的,还是由shell外部的独立二进制文件提供的。如果一个命令是外部命令,那么使用-p参数,会显示该命令的路径,相当于which命令。
1) type dir or type -p dir
dir is hsahed(/usr/bin/dir)
2) type cd
cd is a shell buildin 系统会提示,cd是shell的自带命令(build-in)。
本文详细解释了Linux系统中/etc/passwd文件的各个字段含义,包括用户的加密口令、UID、GID、宿主目录及登录Shell等信息,并介绍了如何使用cut命令来提取这些字段。
668

被折叠的 条评论
为什么被折叠?



