linux add user/ delete user

1.switch to root

su - root

2.add user

#useradd  -u 544 -d /home/user1 -g root -m user1

3.delete user

userdel -r user1

userdel: user dyq is currently used by process ***

ctrl + d

4.others

w

cat  etc/passwd

cat etc/shadow

cat  etc/group

cat /etc/passwd|grep -v nologin|grep -v halt|grep -v shutdown|awk -F":" '{ print $1"|"$3"|"$4 }'|more

 

你可能感兴趣的:(linux)