userdel Command in Linux: Remove User Accounts and Home Directory
Linuxcommands
The userdel command in Linux removes a specified user account from the system. It removes the account from the /etc/passwd, /etc/shadow, and /etc/group files.
The available option is:
- -r: Removes the user's home directory along with their account.
- -f: Forces user removal even if they are logged in
Example:
# userdel –r arthur
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.