2

I'm new in Linux. I've created 5 users using adduser and then removed 'em with deluser according to man pages. On GUI's User Accounts I don't see them.All gone,but in Terminal cd /home/.../ I still can see all users and even navigate and touch file in those accounts folders.id user also gives: no such user. What command(s) shell I use to remove them from bash? Your help will be very appreciated.Thanks.

3 Answers 3

3

Now that you have deleted the user accounts, neither deluser nor userdel will know anything about them or their home directories, since the corresponding /etc/passwd entries are gone. Just manually delete the directories once you have backed up any valuable data:

sudo rm -r /home/user1 /home/user2 ...

You could, of course, have deleted the directories while deleting the user like the other answers suggested.

0
2

sudo deluser --remove-home your_user deletes the home directories as well as the user entries.

The additional option --remove-all-files even removes all the files owned by the user.

0
userdel -r user_id

where -r removes the user's home_dir when being deleted

1
  • The manual page of userdel(8) says: "userdel is a low level utility for removing users. On Debian, administrators should usually use deluser(8) instead." So -1. Mar 10, 2018 at 10:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .