Skip to content

Instantly share code, notes, and snippets.

@hlung
Last active July 23, 2020 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlung/206504910f331953694d02d17a6596da to your computer and use it in GitHub Desktop.
Save hlung/206504910f331953694d02d17a6596da to your computer and use it in GitHub Desktop.
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
@hlung
Copy link
Author

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