Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Colin Stodd
Colin Stodd
3,160 Points

Cannot Delete User Account

I'm doing the Console Foundations Drive, and we created a user account, however, I am unable to delete that account. I searched the web and found something that said to do: sudo userdel 'username' then delete the files by doing: sudo rm -r /home/username but Its not working. The username is still there and able to be logged into. Thanks in advance for your help.

2 Answers

James Barnett
James Barnett
39,199 Points

Not sure exactly what your issue is, I just tried this in the Treehouse console.

sudo useradd test
sudo userdel test

As an aside you can check if the test account is on the system by using sudo grep test /etc/passwd.

Colin Stodd
Colin Stodd
3,160 Points

Sorry to be getting back to you so late James (was out of town). But I wasn't using the "Treehouse Console" I was using the one in Ubuntu 13.10. I created a user account like they do in the Console Dive, but I am not able to delete the account that I created..

James Barnett
James Barnett
39,199 Points

Well those commands should certainly work on ubuntu.

James Barnett
James Barnett
39,199 Points

If the user is currently logged in then you can force the deletion using the -f switch.

sudo userdel -f test

That should work

Idk about Colin, but when I run userdel it says "user Mike the Frog does not exist". Then I take a peek at the login to Linux screen and Mike the Frog is sitting right there. Userdel doesn't seem to be working for me either and I"m not sure how to delete him.