9.6 "Linux learning is not difficult" user management (6): Delete Linux user account
Use the Userdel command to delete a user account from a Linux system, and even delete the user's home directory.
Command syntax:
Userdel [Options] [user name]
The meanings of the options in the command are as shown in the table.
options |
option meaning |
-r |
Delete a user, remove the user's home directory and the directory or file stored in local mail |
- F |
Force delete user |
Example: Delete User Lisi.
[Email protected] ~]# Userdel Lisi
Example: Delete a user moon and delete the home directory while deleting the user.
[Email protected] ~]# Userdel-r Moon
Attention:
using the-r option removes the user's home directory along with the user, so be sure to back up the important data in the home directory before deleting the user account.
This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .
Linux learning is not difficult user management (6): Delete a Linux user account