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

hugo der hungrige picture hugo der hungrige · Sep 15, 2013 · Viewed 182.5k times · Source

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

Answer

hugo der hungrige picture hugo der hungrige · Sep 15, 2013

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