Beginners to learn Linux will certainly encounter some puzzling problems, such as me, in learning to delete a user, the error encountered above
1 |
userdel: user xiaoming is currently used by process 4713 |
, not only that, but when I created this directory, it was successful, but if I su-xiaoming, I found that I reported the error.
1 |
No directory, logging in with HOME=/ |
The solution found in the Linux community has not been solved (perhaps I have to improve the level of information),
This is the answer to the community, and I finally found a similar problem with my csdn and solved it.
The approach is:
My personal speculation is that under the root user su switch to the xiaoming user, and then switch back to root under the Xiaoming user, but the xiaoming user is also occupied by a process, so the process is not dead, the user del does not drop.
So we use Ctrl+d in the command line to exit the current login, and then at the press of Ctrl+d exit Xiaoming User Login, this time we go back to the root of the user, in the use of
You can delete the Xiaoming user.
Also put the delete user and add user commands, it will not be easy to see later
Delete:
Terminal method: Use NewUser instead of the user account you want to delete
Under root User: Userdel-r NewUser
Under normal User: sudo userdel-r newuser
Because the user needs to be completely removed, with the-r option, the user's host directory and the Mail directory are deleted while the user is being deleted.
Added: sudo adduser newuser
Linux "error" Userdel:user Xiaoming is currently used by process 4713 resolution