How to chmod in one shot folders/directories and files

Here is a quick way to change permissions in linux in one shot for directories and files

#For directories only:
chmod 755 $(find /path/to/base/dir -type d)

#For files only:
chmod 644 $(find /path/to/base/dir -type f)

#and for all:
chmod 755 -R /path/to/base/dir

Leave a Reply