Script to change the permission of files and folders in a linux server

FILE—–. find /home/user/public_html -type f -exec chmod 644 ‘{}’ \;

DIRETCORY find /home/user/public_html -type d -exec chmod 755 ‘{}’ \;

1 thought on “Script to change the permission of files and folders in a linux server

  1. Vinisha

    Both of this can be merged together as the script below :

    ————–
    find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \;
    ————–

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.