3 ms·
With xargs (and find), I wish I would've found this sooner: find test -print0 | xargs -0 file "This allows file names that contain newlines or other types of
by aptmiguk 8y ago
With xargs (and find), I wish I would've found this sooner:
find test -print0 | xargs -0 file
"This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the -0 option of xargs."
- tyingq 8y agoPerl also supports -0 and is handy for some use cases because it won't spawn a process per line like xargs. # remove files without spawning lots of rm processes find . -name "*.xyz" -print0 -type f| perl -0 -ne 'chomp;print "$_\n";unlink;'