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