Friday, April 1, 2022

[SOLVED] Change all files and folders permissions of a directory to 644/755

Issue

How would I change all files to 644 and all folders to 755 using chmod from the linux command prompt? (Terminal)


Solution

One approach could be using find:

for directories

find /desired_location -type d -print0 | xargs -0 chmod 0755

for files

find /desired_location -type f -print0 | xargs -0 chmod 0644


Answered By - hugo der hungrige
Answer Checked By - Candace Johnson (WPSolving Volunteer)