Hello, On Sat, 07 Dec 2019, Carlos E.R. wrote:
On 07/12/2019 17.51, David Haller wrote:
On Sat, 07 Dec 2019, Carlos E. R. wrote:
On 07/12/2019 01.42, David T-G wrote: [..]
% % I might try xargs in the script, it would run faster. With the caveat % that we are talking of about 15000 files with paths, more than fits % the line command buffer - unless xargs knows to split in several % lines. I don't remember if it does.
Yes, it does; that is its purpose.
Ok. How do I change:
find /data/storage_b/cer/Pictures -type d \ -exec chgrp cer '{}' \; \ -exec chmod u+r+w+x,g+w+x,o-r-w-x,-t '{}' \; \ -exec setfacl -m g:users:rx '{}' \; \ -exec setfacl -m g:cer:rwx '{}' \;
to using xargs?
Just replace those '\;' with '+'. As in:
find /data/storage_b/cer/Pictures -type d \ -exec chgrp cer '{}' + \ -exec chmod u+r+w+x,g+w+x,o-r-w-x,-t '{}' + \ -exec setfacl -m g:users:rx '{}' + \ -exec setfacl -m g:cer:rwx '{}' +
No, but the question now is using xargs instead.
You propose interesting alternatives, but I don't see the advantage :-? [..] The advantage with xargs is, I assume, that it does
ghgrp args----verylonglinewithathousandfilesatonce
'xargs whatever' fills the commandline to about $(getconf ARG_MAX) i.e. calls 'whatever' with about the max possible argument length. 'find .. -exec whatever .. {} +' does the same, i.e. calls 'whatever' with about the max possible argument length. -dnh -- ``I think I recently decided that if pain is the body's way of saying "Wow, shit, stop! Something is wrong here!", then painkillers are our way of saying "Lalalala! I can't hear you!"'' -- Simon Cozens -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org