Skip to content

Instantly share code, notes, and snippets.

@reening
Created July 21, 2013 20:34
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 reening/6049870 to your computer and use it in GitHub Desktop.
Save reening/6049870 to your computer and use it in GitHub Desktop.
Quick fix for file permissions in my media folder.
#!/bin/bash
DIR=/home/martijn/Music
if [[ $EUID -ne 0 ]]; then
echo "Only root can run this script." 2>&1
exit 1
else
find $DIR -type d -print0 | xargs -0 chmod 0755
find $DIR -type f -print0 | xargs -0 chmod 0644
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment