userdel [options] LOGIN
delete a user account and related files 删除用户
如果有用户正在使用,须kill掉所有该用户的进程,才可以删除此用户
-
常用选项
-r:remove home directory and mail spool 彻底删除用户目录,包括/var/mail等
-
示例:
[root@centos7-test home]# ls xzt123 xzt7566 [root@centos7-test home]# userdel -r xzt123 [root@centos7-test home]# ls xzt7566