bash - Recursively copy user-executable files -


how can recursively copy user-executable files in folder folder?

example, have

in folder folder/one:

-rwxrwxr-x 1 user group 7777777 jun  1 12:00 executable1 -rw-rw-r-- 1 user group    4444 jun  1 12:00 text1.txt 

in folder folder/two:

-rwxrwxr-x 1 user group 7777777 jun  1 12:00 executable2 -rw-rw-r-- 1 user group    4444 jun  1 12:00 text2.txt 

it should recursively copy executable1 , executable2 folder destination folder without preserving original hierarchy.

destination folder should have:

-rwxrwxr-x 1 user group 7777777 jun  1 12:00 executable2 -rwxrwxr-x 1 user group 7777777 jun  1 12:00 executable1 

you use find command:

 find folder -type f -executable -exec echo "{}" /tmp \; 

replace echo cp -p after verify output correct.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -