Linux常用命令-userdel

命令

userdel

描述

delete a user account and related files
删除用户和相关文件

用法

1
userdel [options] LOGIN

选项

1
2
3
Options:
-f 强制删除用户,即使用户处于登录状态
-r 同时删除home目录和mail(不建议使用!)

注意

示例

1
2
3
4
5
6
7
$ userdel userb
$ userdel -f userc
userdel: user userc is currently used by process 18295
$ id userb
id: userb: no such user
$ id userc
id: userc: no such user