Languages

Linux - make all .sh files executable (a+x) for a given directory recursively

4 points
Asked by:
Root-ssh
103620

How can I make all .sh files recursively executable (a+x) below given directory?

1 answer
4 points
Answered by:
Root-ssh
103620

I've found solution using find and ofcourse chmod a+x.

find some_directory -type f -iname "*.sh" -exec chmod a+x {} \;

The command will give a+x rights to all .sh files below some_directory we pick.

Explanation of -iname param:

-iname pattern
  Like -name, but the match is case insensitive.  For example, the patterns `fo*' 
  and `F??' match the file names `Foo', `FOO', `foo', `fOo', etc.
  The  pattern `*foo*` will also match a file called '.foobar'.

 

0 comments Add comment
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join