Last active
July 23, 2020 02:48
-
-
Save hlung/206504910f331953694d02d17a6596da to your computer and use it in GitHub Desktop.
Change ownership of all apps in Applications folder to current user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /Applications -name "*.app" -user old-user -maxdepth 1 | tr \\n \\0 | xargs -0 sudo chown -R $USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 forxargs
instead.