userdel command instructions

1, Command Overview

userdel command to delete the specified user, as well as documents related to the user. If left option, delete user accounts only, without deleting the relevant files. In fact userdel command actually modifies the user account of the file system / etc / passwd, / etc / shadow and / etc / group file.
If you want to remove user-related processes are running, userdel command normally does not delete a user account. If you do need to delete, you can terminate user processes, then perform userdel command to delete. But userdel command also provides a parameter to face this kind of situation, namely "-f" option.

2, the command syntax

userdel [options] [username] 

3, command options

-f: Force delete users, even if the user is currently logged on;
-r: delete users at the same time, deletes all files associated with the user.

4, an example of command

[root@lzg ~]# userdel -f ceshi1
[root@lzg ~]# userdel -r ceshi2

Guess you like

Origin www.cnblogs.com/liuzgg/p/12010711.html