On 05/16/2014 07:15 PM, Assaf Gordon wrote: > Hello, > > I'd like to ask your advice, to verify that my command is correct. > > I'm trying to calculate sha256 checksum on many files, in parallel. > > A contrived example would be: > $ find /path/ -type f -print0 | xargs -0 -P5 -n1 stdbuf -oL sha256sum > 1.txt > > Which would run at most 5 processes of "sha256sum", > and the output of all would be the file 1.txt. > > Is it correct to assume that because "sha256sum" prints one line per file, > and "stdbuf -oL" makes it line-buffered, > that the content in "1.txt" will be valid (i.e. no inter-mixed lines from > different processes) ?
That's correct. Note you don't even need the stdbuf since coreutils 8.1: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=710fe413 thanks, Pádraig.
