The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

userdel - Delete User Accounts 




The userdel command is used to delete user accounts on a Unix-like operating system. It can only be executed by the superuser (root) as it involves making changes to system user account information.

The basic syntax for the userdel command is as follows:
userdel [OPTIONS] USERNAME

Here, "USERNAME" is the name of the user account you want to delete.

Some of the commonly used options for the userdel command include:


For example, if you're logged in as the root user:
userdel -r ken ←Deletes the user account "ken" along with their home directory and email spool

Please exercise caution when using the userdel command, especially with the "-r" option, as it permanently removes user data.

For more details on the userdel command and additional examples, you can refer to the provided link.