Understanding and Using the Userdel Command in Linux

04 May 2023 Balmiki Mandal 0 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.

Author
BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.