Skip to content

Instantly share code, notes, and snippets.

@foxweb
Created January 21, 2022 23:35
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 foxweb/591bdd628e8c6dfff8eb09409d763b0c to your computer and use it in GitHub Desktop.
Save foxweb/591bdd628e8c6dfff8eb09409d763b0c to your computer and use it in GitHub Desktop.
Removing extra files (hidden files from macOS) and files/dirs permissions fix.
#!/bin/sh
sudo chown -R foxweb:foxweb ./*
find . -name "*" -type d -print0 | xargs -0 /bin/chmod 755
find . -name "*" -type f -print0 | xargs -0 /bin/chmod 644
find . -name ".DS_Store" -type f -print0 | xargs -0 /bin/rm
find . -name "._*" -type f -print0 | xargs -0 /bin/rm
find . -name ".AppleDouble" -type d -print0 | xargs -0 /bin/rm -rf
find . -name ".AppleDB" -type d -print0 | xargs -0 /bin/rm -rf
find . -name ".AppleDesktop" -type d -print0 | xargs -0 /bin/rm -rf
find . -name ".TemporaryItems" -type d -print0 | xargs -0 /bin/rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment