• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

deluser: command not found

by Deepika

deluser is a command line tool in Linux that can be used to delete a user account and its related files and directories. It is typically used by system administrators to remove user accounts that are no longer needed.

If you encounter the below error while running the command deluser:

deluser: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install adduser
Ubuntu apt-get install adduser
Kali Linux apt-get install adduser
Raspbian apt-get install adduser

deluser Command Examples

1. Remove a user:

# deluser username

2. Remove a user and their home directory:

# deluser --remove-home username

3. Remove a user and their home, but backup their files into a `.tar.gz` file in the specified directory:

# deluser --backup-to path/to/backup_directory --remove-home username

4. Remove a user, and all files owned by them:

# deluser --remove-all-files username

5. To delete a user account and its related files and directories:

# deluser --backup --remove-all-files username

6. To delete a user account and its related files and directories and also delete the user’s mail spool:

# deluser --backup --remove-all-files --remove-mail-spool username

Please note that deluser is a command that is used to delete a user account from the system, it’s important to be careful when using this command as it can cause data loss if used improperly. It’s always a good idea to backup the data before removing a user account.

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : How to Change the machine-id
  2. How to Create An LVM Snapshot Of The Root Filesystem And Restore To An Earlier State
  3. Beginners guide to Device Mapper (DM) multipathing
  4. powertop Command Examples in Linux
  5. cpufreq-info: command not found
  6. Linux OS Service ‘acpid’
  7. dkms Command Examples in Linux
  8. rpc.statd[PID]: Failed to create listener xprt (statd, 1, udp6) – CentOS/RHEL 6, 7
  9. restorecon: command not found
  10. Linux “seq” Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright