GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Wajig Deluser |
20200804 Users can be removed from the system with the deluser command. Any number of users can be listed.
$ wajig deluser fred mary |
When being removed the home directory is backed up into a compressed tar file (.tar.bz2) and then deleted.
To remove users listed in a file which may have been the output from the adduser command, we can create the list of usernames from that file and pass that to the deluser command. Below we illustrate checking the building of the list of usernames, and once that is right, passing that list on to wajig.
$ cat passwds.txt fred:oi8so4Tha4fei8Ew mary:ohBu4eZeiz0bahth $ cat passwds.txt | cut -d:-f1 fred mary $ cat passwds.txt | cut -d: -f1 | xargs echo fred mary $ wajig deluser `cat passwds.txt | cut -d: -f1 | xargs echo` |