运行命令后,系统提示权限错误,我用的是管理员用户执行的:
$ sudo dscl . delete /Users/test;
Password:
<main> delete status: eDSPermissionError
<dscl_cmd> DS Error: -14120 (eDSPermissionError)
$ sudo rm -fr /Users/test
rm: /Users/test/Pictures: Operation not permitted
rm: /Users/test/Library/Application Support/CallHistoryTransactions: Operation not permitted
rm: /Users/test/Library/Application Support/com.apple.TCC: Operation not permitted
rm: /Users/test/Library/Application Support/CallHistoryDB: Operation not permitted
rm: /Users/test/Library/Application Support: Operation not permitted
rm: /Users/test/Library/IdentityServices: Operation not permitted
rm: /Users/test/Library/Preferences/com.apple.universalaccess.plist: Operation not permitted
rm: /Users/test/Library/Preferences: Operation not permitted
rm: /Users/test/Library/Messages: Operation not permitted
rm: /Users/test/Library/Mail: Operation not permitted
rm: /Users/test/Library/Safari: Operation not permitted
rm: /Users/test/Library/Suggestions: Operation not permitted
rm: /Users/test/Library/Containers: Operation not permitted
rm: /Users/test/Library/Metadata: Operation not permitted
rm: /Users/test/Library/Cookies: Operation not permitted
rm: /Users/test/Library/Caches/CloudKit/com.apple.Safari: Operation not permitted
rm: /Users/test/Library/Caches/CloudKit: Operation not permitted
rm: /Users/test/Library/Caches: Operation not permitted
rm: /Users/test/Library: Operation not permitted
rm: /Users/test: Operation not permitted