Last active
September 1, 2021 11:20
-
-
Save khatriafaz/cc43a95a22449bce86c9f8b17b862612 to your computer and use it in GitHub Desktop.
Shell script to apply proper directory and file permissions after cloning the project on cPanel servers
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
#!/bin/bash | |
username="${1:-$USER}" | |
folder="${2:-.}" | |
chown -R $username:$username $folder | |
find $folder -type f -exec chmod 644 {} \; | |
find $folder -type d -exec chmod 755 {} \; | |
chmod 755 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment