Deleting a User

  • Command: userdel – Deletes a user account.

Options and Considerations

  • Without -r:

  • Deletes the user account only.

  • Home directory and mail spool remain.
  • Files in the home directory become orphaned (owned by UID/GID).
  • Example:

    userdel jane
    
  • With -r:

  • Deletes the user account, home directory, and mail spool.

  • Files outside the home directory remain as orphaned files.
  • Example:

    userdel -r jane
    
  • Important:

  • Backup important files before deleting a user.

  • Deletion is irreversible.