Deleting a User

If you need to delete a user, and you want to track down all the files that belong to the user, use userdel to delete the account, and use find to locate the files belonging to the user.

To delete a user:

# userdel aborg

The user cannot be logged in or running any processes for userdel to work.

userdel removes the user from all system account files (/etc/passwd, etc/shadow, /etc/group), but it does not touch files owned by the user. To remove the user’s home directory and mail spool, add the -r flag:

# userdel -r aborg

Other files, such as crontabs and data files outside the home directory, will have to be hunted down separately:

# find / -uid 1200