尝试编写一个 Bash 脚本,将所有非管理员帐户拉入一个数组,然后我可以删除主目录rm -rf /Users/"$USER"
并删除 Sys Pref user dscl . -delete /Users/"$USER"
。
我可以拉所有管理员,dscl . -read /Groups/admin GroupMembership | grep "$USER" | awk '{ print $3 }'
但无法弄清楚拉非管理员的命令。
任何帮助都会很棒!
You might be able to go about this differently.
Use dscl to read all users in the directory and store results
dscl . list /Users
Use your current dscl call to return all admin users. Store results separate from step one