Understanding and Using the Userdel Command in Linux
What is the Userdel Command in Linux?
The userdel command is used to delete user accounts and related files from a Linux system. It is a standard Linux utility used for managing user accounts, such as adding or deleting users, setting up user groups, etc.
How to Use the Userdel Command?
The syntax for using the userdel command is as follows:
userdel [-r] username
Where: -r is an optional argument that will also delete all of the user's files and directories in their home directory.
Examples of Userdel Commands
To delete a user without deleting their files and directories, use the following command:
userdel john
To delete a user and all of their files and directories, use the following command:
userdel -r john
Conclusion
The userdel command is a useful tool for managing user accounts in Linux. It can be used to quickly and easily delete users from your system.