↑ ↓ select, Enter open, Esc close

Set all files to 644 recursively

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
user@server
find /var/www/vhosts/example.com/httpdocs -type f -exec chmod 644 {} +

Changes only files, not directories, to 644: the owner can read and write, everyone else can only read. This is the usual target state for PHP files, images and stylesheets. Combined with 755 for directories, it brings a messed-up installation back in order.

Note: Executable scripts (such as shell scripts for cron jobs) lose their x permission. Afterwards, set wp-config.php separately to something more restrictive.

Also searched as

  • fix wordpress file permissions
  • chmod 644 files only recursively
  • set files to 644 linux
  • reset 777 permissions

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.