I am trying to delete a user I created on ubuntu.
However when I use the following command:
userdel -r cafe_fixer
user cafe_fixer is currently used by process 15945
kill -9 <pid> to kill the process.
Then use following
userdel command to delete user,
userdel -f cafe_fixer
userdel man page:
This option forces the removal of the user account, even if the user is still logged in. It also forces userdel to remove the user's home directory and mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user. If USERGROUPS_ENAB is defined to yes in /etc/login.defs and if a group exists with the same name as the deleted user, then this group will be removed, even if it is still the primary group of another user.
Note: This option (i.e.
--force) is dangerous and may leave your system in an inconsistent state.