Change directory and folder permissions on mass

From Cheeky Factor

Status: Resolved
Publication date: 2019-09-05
Last edited by: Garyf
Last updated: 2024 - 09 - 1

The problem

Recently, I was doing some work on the on a MediaWiki installation. For some reason I had all the permissions set up wrong.

The resolution

Please note: cheekyfactor.com or the owners of this site cannot be held responsible if things go wrong. You perform these tasks at your own risk.


Device: Server
Operating system: Ubuntu
Software: Command Line Interface

Guidance for Server, Ubuntu, Command Line Interface

Obviously, MediaWiki has thousands of files to change.

So first of all, in the shell, I ran the command from public_html directory:

find -xtype f | xargs chmod 644

That changed the the files. I then ran the following command from the public_html director:

find -xtype d | xargs   chmod 755