Skip to content

Instantly share code, notes, and snippets.

@lucasff
Created July 29, 2014 19:12
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 lucasff/646e3ea332cf29304c30 to your computer and use it in GitHub Desktop.
Save lucasff/646e3ea332cf29304c30 to your computer and use it in GitHub Desktop.
Shell common commands
# Salvar galeria sem as fotos (somente o código-fonte)
# Remove "empty" files
for i in `find /home/*/public_html/* -type f -name 'empty'`; do rm -f $i; done
# Remove error_logs
for i in `find /home/*/public_html/* -type f -name 'error_log'`; do rm -f $i; done
# Permissions fix
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find /home/*/public_html -type d -exec chmod 755 {} \;
find /home/*/public_html -type f -exec chmod 644 {} \;
for i in `find /home/*/public_html/* -type f`; do chmod 644 $i; done
for i in `find /home/*/public_html/* -type d`; do chmod 755 $i; done
chmod 755 /home/*/public_html/cgi-bin/ -R
for i in `ls /var/cpanel/users` ; do chown -R $i.$i /home/$i/public_html/* ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment