Search for executable files using find command

前端 未结 10 850
既然无缘
既然无缘 2020-12-07 11:21

What type of parameter/flag can I use with the Unix find command so that I search executables?

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 12:14

    So as to have another possibility1 to find the files that are executable by the current user:

    find . -type f -exec test -x {} \; -print
    

    (the test command here is the one found in PATH, very likely /usr/bin/test, not the builtin).


    1 Only use this if the -executable flag of find is not available! this is subtly different from the -perm +111 solution.

提交回复
热议问题