How To Delete Existing Users In Ubuntu Linux
Here i will show you how to delete existing user in Ubuntu and the way is same in all Linux flavor.
If you simply use userdel <username> command, this will delete user but it will delete home directory and mailbox location of user.
Check Out : Steps To Create/Add Users
By default, when a user is created, it comes with 5 location mention below,
1. Home directory /home/username
2. Will be define in /etc/passwd
3. will be define in /etc//group
4. will have one mailbox location is /var/spool/mail
5. Password will be define in /etc/shadow
Check Out : Install Times Roman Font In Ubuntu
here i will try to add the same user after deleting just to show you as it’s still having home directory and mailbox exists.
User Delete with Home directory and mailbox
if you want to remove all of these, you will have to use option ‘ -r ‘ to achieve this.
Check Out : How To Clear Cache In Linux
Userdel -r <username>
Now you can see it’s not showing any error while adding the same user after removing with ‘ -r ‘ option.
YouTube : Delete User in ubuntu