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 -xReferences:
fd:findon steroids: https://github.com/sharkdp/fd-x: execute the given command on all matched files
You could also use classic find:
shell
% find . -type f -name '*.ts' -exec chmod -x {} \;Or:
shell
% find . -type f -name '*.ts' | xargs chmod -xOr, with more style safety:
shell
% find . -type f -name '*.ts' -print0 | xargs -0 -n 1 chmod -x∎
Connections
Shared tags