Back to the command reference

userdel

UsersFundamentals In real Linux

Delete a user

Name: userdel = user delete

This command needs a real Linux system; you can practise it in real Linux mode.

Full man page

Description

userdel deletes a user account. Files in the home directory are kept unless you add -r, which also removes the home and mail spool. Make sure the user has no running processes first.

Syntax

userdel [OPTION]... USER

Common options

-r / --removeAlso remove the home directory and mail
-f / --forceRemove even if the user is logged in

Examples

  • $ sudo userdel -r alice

    Delete a user and their home

    Explain

Related