Is it possible to use find + xargs in order to invoke more than one command? I am trying to find all files whose size is greater than 100 chars. and less than 1000 chars , change their permissions and print list of files into file. I can do it with exec e.g
find . -maxdepth 1 -size +100c -size -1000c -exec chmod a+r {} \; -print > testfile But is there any way how to achieve this with xargs?
find . -maxdepth 1 -size +100c -size -1000c -print0 | xargs -0 -I '{}' chmod a+r '{}' -print >testfile the last print wontwon't execute or throws error , is. Is there a way how to achieve it with xargs?