Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] Re: Quick question: how to call a script function from "find"?
  • From: Vojtěch Zeisek <vojtech.zeisek@xxxxxxxxxxxx>
  • Date: Wed, 14 Jun 2017 08:24:07 +0200
  • Message-id: <3891699.UcrATMztnv@tilia>
Dne středa 14. června 2017 2:20:09 CEST, L A Walsh napsal(a):
L A Walsh wrote:
Vojtěch Zeisek wrote:
find /home/cer/Fusion/Videos/ -type d | parallel "sudo... && chmod...
This is my favorite style. :-)

How is that different from using 'xargs -N1 -j#threads'?

oops: Make those -n1 and -P. I seem to remember arguing w/the
gnuboys about not using -j, but they usually do anything
other than what I suggest.

I'm not so familiar with xargs. 'parallel -j #' says how many of available CPU
threads to use (otherwise Parallel uses all available CPU threads). My 'xargs'
(TW) doesn't know args '-N' and '-j', but xargs, as far as I understand,
"just" does groups of given size (length of arguments). See 'ls', 'ls | xargs'
and 'ls | xargs 4'. It is a different task. GNU Parallel takes care about
optimal usage of given numbers of threads. xargs makes perfect sense e.g. if I
need to delete files in directory with so many files, that expansion of 'rm *'
would be too long argument for rm, or so. But I don't want to hitchhike the
thread. :-)

Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux
< Previous Next >
Follow Ups