Skip to content

Instantly share code, notes, and snippets.

for /f "tokens=1,2" %i in ('udadmin -list ^| find /i "@"') do @udadmin -f %j -user %i -delete
For each line
find users with this search criteria
in that list
find users without this search criteria
in that list
## Removes everything but base. Don't use F-kit unless you really mean to.
## Warning
## This isn't my code
## I found this and need to make sure i keep it.
## ArchLinux F-Kit
pacman -R $(comm -23 <(pacman -Qq|sort) <((for i in $(pacman -Qqg base); do pactree -ul $i; done)|sort -u|cut -d ' ' -f 1))