Deluser command --remove-home vs --remove-all-files

Hello Friends

The deluser command has these two options:

--remove-home
  Remove the home directory of the user and its mailspool. 
  If --backup is specified, the files are deleted after having performed the backup.

--remove-all-files
  Remove  all  files from the system owned by this user. 
  Note: --remove-home does not have an effect any more.
  If --backup is specified, the files are deleted after having performed the backup.

I confirmed the --remove-home option deletes the user as expected and his /home/<username> directory is deleted too. But I want to understand in a 100% the --remove-all-files option. Can you clarify each line of its description? Mostly the two first ones. I want understand when is mandatory use the --remove-all-files option over the --remove-home option.

Thanks in advance

I don’t know about “mandatory”, but if you use --remove-all-files it would presumably remove files not inside the user’s home directory but are owned by the user. That could be dangerous if there are shared documents you still want access to.

I haven’t used either option to give a real-world experience.

3 Likes

Thanks for the reply,

I thought in some way the same assumption, but according with my understanding theoretically is better share resources among users based on secondary groups and through common paths such as /srv and /opt.

Let’s see if other members in the forum had an experience where was “mandatory” use the --remove-all-files option

1 Like

Hi Manuel,
I have no experience with that command
but
I must say those extracts from a man page which you quote
are very poorly written and probably ambiguous.
There is a need for some effort to rewrite such poorly written
documentation.
People for whom English is not a first language are going to
really struggle with such illogical documentation.
Regards
Neville

1 Like