<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Xargs on Michael’s Domain</title><link>https://jeltsch.org/en/tags/xargs/</link><description>Recent content in Xargs on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/xargs/index.xml" rel="self" type="application/rss+xml"/><item><title>Piping the output of find into a new command (find, xargs)</title><link>https://jeltsch.org/en/piping_the_output_of_find_into_a_new_command_find_xargs/</link><pubDate>Wed, 23 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/piping_the_output_of_find_into_a_new_command_find_xargs/</guid><description>&lt;p&gt;E.g. to change the permissions of all directories:&lt;code&gt;find . -type d -print | xargs /bin/chmod ug+rx&lt;/code&gt;To be able to handle directory names with special characters&lt;code&gt;find . -type d -print0 | xargs -0 /bin/chmod ug+rx&lt;/code&gt;In order to find all tif files in the current directory or below and to compress them (using the ImageMagick &amp;ldquo;mogrify&amp;rdquo; command and LZW compression):&lt;code&gt;find . -name '*.tif' -print | xargs mogrify -compress LZW&lt;/code&gt;Apart from the &amp;ldquo;xargs&amp;rdquo; method, some command (including find) accept the &amp;ldquo;-exec&amp;rdquo; argument. The following finds all files in the current directory that are smaller than 4k and deletes them:&lt;code&gt;find . -size -4k -exec rm {} \;&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>