I m trying to delete a user. I was logged in from Root and tried a delete a existing user using userdel -r sammy(sammy is the user name) it is showing a error that the user is currently logged in but any other user exept of root is not logged in. How can i delete the user??
w | grep sammy
. The user may also still have some files/sockets open. Verify that withsudo lsof -n | grep sammy
. And I want to recommend usingdeluser
overuserdel
as it is more high-level and easier to use (less likely to break things; similar toadduser
vs.useradd
).