The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,184 other subscribers

Archive for March 7th, 2023

linux – Newline-separated xargs – Server Fault

Posted by jpluimers on 2023/03/07

A long time ago, on just one system, I forgot which one, I needed explicit [Wayback/Archive] linux – Newline-separated xargs – Server Fault.

The simple solution was to replace the newline with null before running xargs:

tr '\n' '\0'

The clean solution was to install gnu xargs:

GNU xargs (default on Linux; install findutils from MacPorts on OS X to get it) supports -d which lets you specify a custom delimiter for input, so you can do

ls *foo | xargs -d '\n' -P4 foo 

–jeroen

Posted in *nix, *nix-tools, bash, Development, Power User, Scripting, Software Development, xargs | Leave a Comment »

 
%d bloggers like this: