Closed clochix closed 7 years ago
We can use this as a base:
# cat /etc/passwd | cut -d":" -f1 | grep cozy
This lists all users beginning with "cozy".
I tried it on my personnal server (after creating fake "cozy-" accounts), but didn't seem to be able to pipe userdel
to this command line.
Alternatively, a for
loop in a bash script should do the trick.
Maybe with xargs
:
cat /etc/passwd | cut -d":" -f1 | grep cozy | xargs -L1 userdel
@nono we should use a moar specific regex, like ^cozy\-
.
@clochix yes, my comment was just an answer to @babolivier to show xargs
We should find a way to delete every users created by Cozy.