BULK LINUX CHMOD COMMANDS FOR FILES & DIRECTORIES

Industry:, ,

Recently in Ubuntu which I use for my hosting operating system of choice I needed to bulk change permissions on a bunch of folders and files. I needed to set permissions on folders within a WordPress installation to 755 and all files in theme, plugin and asset directories to 644.

 

While my command line-fu is not very strong, I was able to work it out and I thought I would share my findings here for others.

To bulk change permissions on folders:

find /yourlocationwithfolders -type d -exec chmod 755 {} \;

To bulk change permissions on files:

find /yourlocationwithfolders -type f -exec chmod 644 {} \;

You can use the -R recursive flag with chmod, but it will not allow you to set permissions on all folders and files, but rather on everything (which is rare you would want to set permissions on everything to be the same).

case studies

See More Case Studies

Contact us

Partner With Us for Enterprise-Grade IT Solutions

We’re here to answer your questions and help you identify the right solutions tailored to your business needs.
Your benefits:
What happens next?
1

We Schedule a call at your convenience 

2

We do a discovery and consulting meting 

3

We prepare a proposal 

Schedule a Free Consultation