Quantcast
Channel: Autarchy of the Private Cave » how-to
Viewing all articles
Browse latest Browse all 35

Best method to recursively chmod/process files or directories

$
0
0

Found here.

Recursively set directories only to drwx-rx-rx (755):

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

Recursively set files only to rwx-r-r (644):

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

Recursively remove carriage returns (^M) from the end of all *.php files:

find . -type f -name “*.php” -exec /home/user/dos2unix.sh {} \;

In all these cases, {} is replaced with the filename/directory find has found matching your parameters; \; at the end just stops exec processing.

Share


Viewing all articles
Browse latest Browse all 35

Trending Articles