thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

Remove the executable bit from all files with a given extension

β€’ 83 words β€’ 1 min β€’ updated

⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.

To illustrate, consider TypeScript files (*.ts).

Run:

shell
% fd -e .ts -x chmod -x

References:

You could also use classic find:

shell
% find . -type f -name '*.ts' -exec chmod -x {} \;

Or:

shell
% find . -type f -name '*.ts' | xargs chmod -x

Or, with more style safety:

shell
% find . -type f -name '*.ts' -print0 | xargs -0 -n 1 chmod -x