User Tools

Site Tools


selective_chmod_for_directories_and_files

Selective chmod for directories and files

Here’s how to apply one set of permissions to all files, and a different set of permissions to all directories, in Linux (example):

First cd to the directory containing the subdirectories and files you want to change. Then:

For directories:

find . -type d -exec chmod 755 {} \;

For files:

find . -type f -exec chmod 644 {} \;

(You’ll need to change the 755 and 644 to the actual permissions you want, obviously.)

selective_chmod_for_directories_and_files.txt · Last modified: 2024/08/11 18:08 by jimc