<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pedromussato.com/index.php?action=history&amp;feed=atom&amp;title=Stream_text_processing</id>
	<title>Stream text processing - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pedromussato.com/index.php?action=history&amp;feed=atom&amp;title=Stream_text_processing"/>
	<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=Stream_text_processing&amp;action=history"/>
	<updated>2026-04-10T15:09:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.pedromussato.com/index.php?title=Stream_text_processing&amp;diff=19&amp;oldid=prev</id>
		<title>413vhcu1lq0463ob: Created page with &quot;=== cat === Reads a text file  Some useful options:  * -n show line numbers * -b show non blank line numbers * -s split multiple break lines into single break line * -A shows special chars  ==== tac (the opposite of cat) ==== Reads a text file from the last line to the first  === head === Reads the first 10 lines of the file (some distros uses 5 by default)  Some useful options:  * -n&lt;number&gt; shows this number of lines * -&lt;number&gt; shows this number of lines * -c&lt;number&gt;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=Stream_text_processing&amp;diff=19&amp;oldid=prev"/>
		<updated>2024-10-06T22:32:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== cat === Reads a text file  Some useful options:  * -n show line numbers * -b show non blank line numbers * -s split multiple break lines into single break line * -A shows special chars  ==== tac (the opposite of cat) ==== Reads a text file from the last line to the first  === head === Reads the first 10 lines of the file (some distros uses 5 by default)  Some useful options:  * -n&amp;lt;number&amp;gt; shows this number of lines * -&amp;lt;number&amp;gt; shows this number of lines * -c&amp;lt;number&amp;gt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== cat ===&lt;br /&gt;
Reads a text file&lt;br /&gt;
&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -n show line numbers&lt;br /&gt;
* -b show non blank line numbers&lt;br /&gt;
* -s split multiple break lines into single break line&lt;br /&gt;
* -A shows special chars&lt;br /&gt;
&lt;br /&gt;
==== tac (the opposite of cat) ====&lt;br /&gt;
Reads a text file from the last line to the first&lt;br /&gt;
&lt;br /&gt;
=== head ===&lt;br /&gt;
Reads the first 10 lines of the file (some distros uses 5 by default)&lt;br /&gt;
&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -n&amp;lt;number&amp;gt; shows this number of lines&lt;br /&gt;
* -&amp;lt;number&amp;gt; shows this number of lines&lt;br /&gt;
* -c&amp;lt;number&amp;gt; show this number of bytes&lt;br /&gt;
&lt;br /&gt;
=== tail ===&lt;br /&gt;
Reads the last 10 lines of the file (some distros uses 5 by default)&lt;br /&gt;
&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -n&amp;lt;number&amp;gt; shows this number of lines&lt;br /&gt;
* -&amp;lt;number&amp;gt; shows this number of lines&lt;br /&gt;
* -c&amp;lt;number&amp;gt; show this number of bytes&lt;br /&gt;
* -f will read the last lines and keep watching for new inputs&lt;br /&gt;
&lt;br /&gt;
=== less ===&lt;br /&gt;
Reads a file by paginating it, you can navigate with the arrows and pg up/pg down.&lt;br /&gt;
&lt;br /&gt;
By typing / you can search a pattern, with n you go to the next occurrence and with tipping N (or p) it will go to the past occurrence.&lt;br /&gt;
&lt;br /&gt;
=== wc ===&lt;br /&gt;
Reads the amount of lines, words and chars.&lt;br /&gt;
Some useful options:&lt;br /&gt;
* -l shows the amount of lines&lt;br /&gt;
* -c or --bytes shows the amount of bytes&lt;br /&gt;
* -m or --chars shows the amount of chars&lt;br /&gt;
&lt;br /&gt;
=== nl ===&lt;br /&gt;
Similar to the cat -b, will enumerate file lines and not counting empty lines.&lt;br /&gt;
&lt;br /&gt;
=== sort ===&lt;br /&gt;
Will sort the lines by alphabetical order.&lt;br /&gt;
Some useful options:&lt;br /&gt;
* -r will reverse the sort output&lt;br /&gt;
* -k&amp;lt;number&amp;gt; will sort by the second field (after the first space/tab)&lt;br /&gt;
&lt;br /&gt;
=== uniq ===&lt;br /&gt;
Shows unique occurrences of the lines removing lines that already have been shown in sequence (if two lines have the same content but the lines aren&amp;#039;t one before the other it will show again).&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -d shows only the duplicate lines&lt;br /&gt;
* -c count how many times the line had occured&lt;br /&gt;
&lt;br /&gt;
=== od (octal dump) ===&lt;br /&gt;
Reads the file as octal&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -tx or -t x2 shows in hexadecimal&lt;br /&gt;
&lt;br /&gt;
=== join ===&lt;br /&gt;
Bond to files using an index thats by default the first field.&lt;br /&gt;
&lt;br /&gt;
(e.g.)&lt;br /&gt;
 sh-5.2$ cat users &lt;br /&gt;
 1 user1&lt;br /&gt;
 2 user2&lt;br /&gt;
 3 user3&lt;br /&gt;
 sh-5.2$ cat rating &lt;br /&gt;
 1 4.9&lt;br /&gt;
 2 4.7&lt;br /&gt;
 3 4.5&lt;br /&gt;
 sh-5.2$ join users rating &lt;br /&gt;
 1 user1 4.9&lt;br /&gt;
 2 user2 4.7&lt;br /&gt;
 3 user3 4.5&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -j&amp;lt;number&amp;gt; specifies what field will be the index field&lt;br /&gt;
&lt;br /&gt;
=== paste ===&lt;br /&gt;
Will bond each line of each file together.&lt;br /&gt;
&lt;br /&gt;
(e.g.)&lt;br /&gt;
 sh-5.2$ cat users &lt;br /&gt;
 1 user1&lt;br /&gt;
 2 user2&lt;br /&gt;
 3 user3&lt;br /&gt;
 sh-5.2$ cat rating &lt;br /&gt;
 1 4.9&lt;br /&gt;
 2 4.7&lt;br /&gt;
 3 4.5&lt;br /&gt;
 sh-5.2$ paste users rating &lt;br /&gt;
 1 user1	1 4.9&lt;br /&gt;
 2 user2	2 4.7&lt;br /&gt;
 3 user3	3 4.5&lt;br /&gt;
&lt;br /&gt;
=== split ===&lt;br /&gt;
Splits a file into multiple files by default split in 1000 lines files like xaa, xab xac and etc...&lt;br /&gt;
Some useful options:&lt;br /&gt;
* -l&amp;lt;number&amp;gt; or -&amp;lt;number&amp;gt; how much lines will be the output files.&lt;br /&gt;
* b&amp;lt;number&amp;gt; how much bytes will be the output files.&lt;br /&gt;
(e.g.)&lt;br /&gt;
 sh-5.2# ls -l&lt;br /&gt;
 total 56&lt;br /&gt;
 -rw-r--r-- 1 root root 56827 Aug  6 19:33 test_file&lt;br /&gt;
 sh-5.2# wc -l test_file &lt;br /&gt;
 591 test_file&lt;br /&gt;
 sh-5.2# split -l300 test_file &lt;br /&gt;
 sh-5.2# ls -l&lt;br /&gt;
 total 116&lt;br /&gt;
 -rw-r--r-- 1 root root 56827 Aug  6 19:33 test_file&lt;br /&gt;
 -rw-r--r-- 1 root root 27759 Aug  6 19:37 xaa&lt;br /&gt;
 -rw-r--r-- 1 root root 29068 Aug  6 19:37 xab&lt;br /&gt;
 sh-5.2# split -l300 test_file renamed_output_&lt;br /&gt;
 sh-5.2# ls -l&lt;br /&gt;
 total 176&lt;br /&gt;
 -rw-r--r-- 1 root root 27759 Aug  6 19:37 renamed_output_aa&lt;br /&gt;
 -rw-r--r-- 1 root root 29068 Aug  6 19:37 renamed_output_ab&lt;br /&gt;
 -rw-r--r-- 1 root root 56827 Aug  6 19:33 test_file&lt;br /&gt;
 -rw-r--r-- 1 root root 27759 Aug  6 19:37 xaa&lt;br /&gt;
 -rw-r--r-- 1 root root 29068 Aug  6 19:37 xab&lt;br /&gt;
&lt;br /&gt;
=== tr ===&lt;br /&gt;
Will override characters from inputs with other characters, will only read from stdin.&lt;br /&gt;
&lt;br /&gt;
(e.g.)&lt;br /&gt;
 sh-5.2$ cat users &lt;br /&gt;
 1 user1&lt;br /&gt;
 2 user2&lt;br /&gt;
 3 user3&lt;br /&gt;
 sh-5.2$ cat users | tr [:lower:] [:upper:]&lt;br /&gt;
 1 USER1&lt;br /&gt;
 2 USER2&lt;br /&gt;
 3 USER3&lt;br /&gt;
 sh-5.2$ cat users | tr &amp;#039; &amp;#039; &amp;#039;_&amp;#039;&lt;br /&gt;
 1_user1&lt;br /&gt;
 2_user2&lt;br /&gt;
 3_user3&lt;br /&gt;
 sh-5.2$ cat users | tr e J&lt;br /&gt;
 1 usJr1&lt;br /&gt;
 2 usJr2&lt;br /&gt;
 3 usJr3&lt;br /&gt;
 sh-5.2$ cat users | tr -d u&lt;br /&gt;
 1 ser1&lt;br /&gt;
 2 ser2&lt;br /&gt;
 3 ser3&lt;br /&gt;
&lt;br /&gt;
Some useful options:&lt;br /&gt;
&lt;br /&gt;
* -d Will delete the occurrence.&lt;br /&gt;
&lt;br /&gt;
=== cut ===&lt;br /&gt;
=== sed ===&lt;/div&gt;</summary>
		<author><name>413vhcu1lq0463ob</name></author>
	</entry>
</feed>