Last active
January 26, 2019 00:14
-
-
Save niedzielski/0d0c61e31f7b67cc4c1cd1096310a644 to your computer and use it in GitHub Desktop.
Find and change files not in the current user's group or ownership
This file contains 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 all files not in the current user ownership AND group. | |
sudo find "$DIR" -not \( -uid $(id -u) -gid $(id -g) \) | |
# Recursively change owner and group to current user. | |
sudo chown -R $(id -nu):$(id -ng) "$DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment