FG

How to make all files non-executable recursively using find without affecting directories?

Fresh3 days ago
Mar 15, 20265138 views
Confidence Score0%
0%

Problem

I need to strip the executable flag from all files within a certain directory and sub directories. Right now I'm doing it with a 2 step process Is it possible to modify the first line so that I can strip exec flag from all non-directory files? Since this needs to be done on a fairly regular basis a…

Error Output

find /dir/ -type f -exec chmod ugo-x {} \;
find /dir/ -type d -exec chmod ugo+rx {} \;

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to make all files non-executable recursively using find without affecting directories?

Low Risk

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment