<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tbpindustries.com/index.php?action=history&amp;feed=atom&amp;title=Xargs</id>
	<title>Xargs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tbpindustries.com/index.php?action=history&amp;feed=atom&amp;title=Xargs"/>
	<link rel="alternate" type="text/html" href="https://wiki.tbpindustries.com/index.php?title=Xargs&amp;action=history"/>
	<updated>2026-05-15T12:51:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.tbpindustries.com/index.php?title=Xargs&amp;diff=183&amp;oldid=prev</id>
		<title>Goldbolt: /* Usage */</title>
		<link rel="alternate" type="text/html" href="https://wiki.tbpindustries.com/index.php?title=Xargs&amp;diff=183&amp;oldid=prev"/>
		<updated>2019-12-18T19:12:50Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 19:12, 18 December 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; cat foobar.txt | grep bar | xargs -I '{}' sed 's/foo/{}/g' file.txt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; cat foobar.txt | grep bar | xargs -I '{}' sed 's/foo/{}/g' file.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Randomly shuffles output of grep of &amp;quot;us1234.thing.txt&amp;quot; and only prints up to the first instance of &amp;quot;.&amp;quot; due to awk: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Randomly shuffles output of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ls and &lt;/ins&gt;grep of &amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/dir1/dir2/&lt;/ins&gt;us1234.thing.txt&amp;quot; and only prints up to the first instance of &amp;quot;.&amp;quot; due to awk: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; ls /dir1/dir2/ |grep us |awk -F &amp;quot;.&amp;quot; '{print $1}' | xargs shuf -n1 -e&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; ls /dir1/dir2/ |grep us |awk -F &amp;quot;.&amp;quot; '{print $1}' | xargs shuf -n1 -e&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Goldbolt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tbpindustries.com/index.php?title=Xargs&amp;diff=182&amp;oldid=prev</id>
		<title>Goldbolt: Created page with &quot; xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tbpindustries.com/index.php?title=Xargs&amp;diff=182&amp;oldid=prev"/>
		<updated>2019-12-18T19:12:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments to a command.&lt;br /&gt;
&lt;br /&gt;
Some commands such as grep and awk can take input either as command-line arguments or from the standard input. However, others such as cp and echo can only take input as arguments, which is why xargs is used instead. &lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
&lt;br /&gt;
Pipe output from cat and grep into sed to replace &amp;quot;foo&amp;quot; with &amp;quot;bar&amp;quot; within file.txt:&lt;br /&gt;
&lt;br /&gt;
    cat foobar.txt | grep bar | xargs -I '{}' sed 's/foo/{}/g' file.txt&lt;br /&gt;
&lt;br /&gt;
Randomly shuffles output of grep of &amp;quot;us1234.thing.txt&amp;quot; and only prints up to the first instance of &amp;quot;.&amp;quot; due to awk: &lt;br /&gt;
&lt;br /&gt;
    ls /dir1/dir2/ |grep us |awk -F &amp;quot;.&amp;quot; '{print $1}' | xargs shuf -n1 -e&lt;/div&gt;</summary>
		<author><name>Goldbolt</name></author>
		
	</entry>
</feed>