Skip to content

Instantly share code, notes, and snippets.

Last active July 23, 2020 02:48
What would you like to do?
Change ownership of all apps in Applications folder to current user
find /Applications -name "*.app" -user old-user -maxdepth 1 | tr \\n \\0 | xargs -0 sudo chown -R $USER
Copy link

hlung commented Jul 23, 2020

The tr \\n \\0 | xargs -0 part is to avoid recognizing spaces as command terminators. It replaces new line and space with null \0 character, and use it as terminator for xargs instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment