September 20, 2025
Linux Command Line

Linux Command Line

In Linux, the “deluser” command is used to delete a user account and its associated files. This command is typically used when a user is no longer needed or when a user’s account needs to be revoked. It is important to note that the “deluser” command only deletes the user’s account, and not their home directory or files. In order to delete a user’s home directory and files, the “userdel” command should be used instead.

To use the “deluser” command, the user must have root or superuser privileges. The basic syntax for the command is as follows:

deluser [options] username

Here are some examples of how to use the “deluser” command:

  1. To delete a user account named “john” without deleting their home directory or files:
sudo deluser john
  1. To delete a user account named “jane” and all of her files:
sudo deluser --remove-home jane
  1. To delete a user account named “jake” and all of its files and also group
sudo deluser --remove-home --group jake

It’s important to note that deleting a user account with the “deluser” command is permanent and cannot be undone. Therefore, it is recommended to use this command with caution and to always make sure that the user’s account and files are not needed before proceeding with deletion.

In summary, the “deluser” command is a powerful tool for managing user accounts on Linux systems. It can be used to delete a user account and its associated files, but it is important to use it with caution and to understand its options and parameters.

See our list of 75 Linux commands you should know about.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Share via
Copy link
Powered by Social Snap