You've already forked uutils.github.io
mirror of
https://github.com/uutils/uutils.github.io.git
synced 2026-06-10 16:12:28 -07:00
deploy: f0e8d44e6e
This commit is contained in:
+11
-11
@@ -1374,7 +1374,7 @@ With no FILE, or when FILE is -, read standard input.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 id="examples-7"><a class="header" href="#examples-7">Examples</a></h2>
|
||||
<p>Print the contents of a file to the standard output:</p>
|
||||
<p>Print the contents of a file to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">cat {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Concatenate several files into an output file:</p>
|
||||
@@ -3393,10 +3393,10 @@ With no <code>FILE</code>, or when <code>FILE</code> is <code>-</code>, read sta
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 id="examples-27"><a class="header" href="#examples-27">Examples</a></h2>
|
||||
<p>Convert tabs in each file to spaces, writing to standard output:</p>
|
||||
<p>Convert tabs in each file to spaces, writing to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">expand {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Convert tabs to spaces, reading from standard input:</p>
|
||||
<p>Convert tabs to spaces, reading from <code>stdin</code>:</p>
|
||||
<pre><code class="language-shell">expand
|
||||
</code></pre>
|
||||
<p>Do not convert tabs after non blanks:</p>
|
||||
@@ -5336,7 +5336,7 @@ expression, <code>BRE</code></li>
|
||||
<p>Number non-blank lines in a file:</p>
|
||||
<pre><code class="language-shell">nl {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Read from standard output:</p>
|
||||
<p>Read from <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">cat {{path/to/file}} | nl {{options}} -
|
||||
</code></pre>
|
||||
<p>Number only the lines with printable text:</p>
|
||||
@@ -8224,13 +8224,13 @@ In this case the corresponding stream will be fully buffered with the buffer siz
|
||||
<p>NOTE: If <code>COMMAND</code> adjusts the buffering of its standard streams (<code>tee</code> does for e.g.) then that will override corresponding settings changed by <code>stdbuf</code>.
|
||||
Also some filters (like <code>dd</code> and <code>cat</code> etc.) don't use streams for I/O, and are thus unaffected by <code>stdbuf</code> settings.</p>
|
||||
<h2 id="examples-83"><a class="header" href="#examples-83">Examples</a></h2>
|
||||
<p>Change the standard input buffer size to 512 KiB:</p>
|
||||
<p>Change <code>stdin</code> buffer size to 512 KiB:</p>
|
||||
<pre><code class="language-shell">stdbuf --input={{512K}} {{command}}
|
||||
</code></pre>
|
||||
<p>Change the standard output buffer to line-buffered:</p>
|
||||
<p>Change <code>stdout</code> buffer to line-buffered:</p>
|
||||
<pre><code class="language-shell">stdbuf --output={{L}} {{command}}
|
||||
</code></pre>
|
||||
<p>Change the standard error buffer to unbuffered:</p>
|
||||
<p>Change <code>stderr</code> buffer to unbuffered:</p>
|
||||
<pre><code class="language-shell">stdbuf --error={{0}} {{command}}
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
@@ -8542,13 +8542,13 @@ With no FILE, or when FILE is -, read standard input.</p>
|
||||
</dl>
|
||||
<p>If a FILE is -, it refers to a file named - .</p>
|
||||
<h2 id="examples-89"><a class="header" href="#examples-89">Examples</a></h2>
|
||||
<p>Copy standard input to each file, and also to standard output:</p>
|
||||
<p>Copy <code>stdin</code> to each file, and also to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">echo "example" | tee {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Append to the given files, do not overwrite:</p>
|
||||
<pre><code class="language-shell">echo "example" | tee -a {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Print standard input to the terminal, and also pipe it into another program for further processing:</p>
|
||||
<p>Print <code>stdin</code> to the terminal, and also pipe it into another program for further processing:</p>
|
||||
<pre><code class="language-shell">echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}
|
||||
</code></pre>
|
||||
<p>Create a directory called "example", count the number of characters in "example" and write "example" to the terminal:</p>
|
||||
@@ -9158,10 +9158,10 @@ With no <code>FILE</code>, or when <code>FILE</code> is <code>-</code>, read sta
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 id="examples-99"><a class="header" href="#examples-99">Examples</a></h2>
|
||||
<p>Convert blanks in each file to tabs, writing to standard output:</p>
|
||||
<p>Convert blanks in each file to tabs, writing to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">unexpand {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Convert blanks to tabs, reading from standard output:</p>
|
||||
<p>Convert blanks to tabs, reading from <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">unexpand
|
||||
</code></pre>
|
||||
<p>Convert all blanks, instead of just initial blanks:</p>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -247,7 +247,7 @@ With no FILE, or when FILE is -, read standard input.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
|
||||
<p>Print the contents of a file to the standard output:</p>
|
||||
<p>Print the contents of a file to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">cat {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Concatenate several files into an output file:</p>
|
||||
|
||||
@@ -223,10 +223,10 @@ With no <code>FILE</code>, or when <code>FILE</code> is <code>-</code>, read sta
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
|
||||
<p>Convert tabs in each file to spaces, writing to standard output:</p>
|
||||
<p>Convert tabs in each file to spaces, writing to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">expand {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Convert tabs to spaces, reading from standard input:</p>
|
||||
<p>Convert tabs to spaces, reading from <code>stdin</code>:</p>
|
||||
<pre><code class="language-shell">expand
|
||||
</code></pre>
|
||||
<p>Do not convert tabs after non blanks:</p>
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ expression, <code>BRE</code></li>
|
||||
<p>Number non-blank lines in a file:</p>
|
||||
<pre><code class="language-shell">nl {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Read from standard output:</p>
|
||||
<p>Read from <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">cat {{path/to/file}} | nl {{options}} -
|
||||
</code></pre>
|
||||
<p>Number only the lines with printable text:</p>
|
||||
|
||||
@@ -230,13 +230,13 @@ In this case the corresponding stream will be fully buffered with the buffer siz
|
||||
<p>NOTE: If <code>COMMAND</code> adjusts the buffering of its standard streams (<code>tee</code> does for e.g.) then that will override corresponding settings changed by <code>stdbuf</code>.
|
||||
Also some filters (like <code>dd</code> and <code>cat</code> etc.) don't use streams for I/O, and are thus unaffected by <code>stdbuf</code> settings.</p>
|
||||
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
|
||||
<p>Change the standard input buffer size to 512 KiB:</p>
|
||||
<p>Change <code>stdin</code> buffer size to 512 KiB:</p>
|
||||
<pre><code class="language-shell">stdbuf --input={{512K}} {{command}}
|
||||
</code></pre>
|
||||
<p>Change the standard output buffer to line-buffered:</p>
|
||||
<p>Change <code>stdout</code> buffer to line-buffered:</p>
|
||||
<pre><code class="language-shell">stdbuf --output={{L}} {{command}}
|
||||
</code></pre>
|
||||
<p>Change the standard error buffer to unbuffered:</p>
|
||||
<p>Change <code>stderr</code> buffer to unbuffered:</p>
|
||||
<pre><code class="language-shell">stdbuf --error={{0}} {{command}}
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
|
||||
+2
-2
@@ -227,13 +227,13 @@
|
||||
</dl>
|
||||
<p>If a FILE is -, it refers to a file named - .</p>
|
||||
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
|
||||
<p>Copy standard input to each file, and also to standard output:</p>
|
||||
<p>Copy <code>stdin</code> to each file, and also to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">echo "example" | tee {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Append to the given files, do not overwrite:</p>
|
||||
<pre><code class="language-shell">echo "example" | tee -a {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Print standard input to the terminal, and also pipe it into another program for further processing:</p>
|
||||
<p>Print <code>stdin</code> to the terminal, and also pipe it into another program for further processing:</p>
|
||||
<pre><code class="language-shell">echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}
|
||||
</code></pre>
|
||||
<p>Create a directory called "example", count the number of characters in "example" and write "example" to the terminal:</p>
|
||||
|
||||
@@ -227,10 +227,10 @@ With no <code>FILE</code>, or when <code>FILE</code> is <code>-</code>, read sta
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
|
||||
<p>Convert blanks in each file to tabs, writing to standard output:</p>
|
||||
<p>Convert blanks in each file to tabs, writing to <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">unexpand {{path/to/file}}
|
||||
</code></pre>
|
||||
<p>Convert blanks to tabs, reading from standard output:</p>
|
||||
<p>Convert blanks to tabs, reading from <code>stdout</code>:</p>
|
||||
<pre><code class="language-shell">unexpand
|
||||
</code></pre>
|
||||
<p>Convert all blanks, instead of just initial blanks:</p>
|
||||
|
||||
Reference in New Issue
Block a user