<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: 6 Wc Command to Count Number of Lines, Words, and Characters in File	</title>
	<atom:link href="https://www.tecmint.com/wc-command-examples/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/wc-command-examples/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Tue, 23 Jan 2024 04:31:04 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Ravi Saive		</title>
		<link>https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-2128725</link>

		<dc:creator><![CDATA[Ravi Saive]]></dc:creator>
		<pubDate>Tue, 23 Jan 2024 04:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=2278#comment-2128725</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-901825&quot;&gt;T-T-T&lt;/a&gt;.

@TTT

If you want to count the occurrences of the line &quot;01:19:21&quot; in a text file using a Linux command, you can use the following command:
&lt;pre&gt;
grep -c &quot;01:19:21&quot; data.txt
&lt;/pre&gt;
This will output the number of lines in the file that contain &quot;01:19:21&quot;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-901825">T-T-T</a>.</p>
<p>@TTT</p>
<p>If you want to count the occurrences of the line &#8220;01:19:21&#8221; in a text file using a Linux command, you can use the following command:</p>
<pre>
grep -c "01:19:21" data.txt
</pre>
<p>This will output the number of lines in the file that contain &#8220;01:19:21&#8221;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vincent Ypma		</title>
		<link>https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-2128624</link>

		<dc:creator><![CDATA[Vincent Ypma]]></dc:creator>
		<pubDate>Mon, 22 Jan 2024 18:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=2278#comment-2128624</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-901825&quot;&gt;T-T-T&lt;/a&gt;.

The command is attempting to filter and count the lines containing the string &quot;&lt;strong&gt;01:19:21&lt;/strong&gt;&quot; in a text file or a stream of text.
&lt;pre&gt;
$lines_of_text &#124; grep 01:19:21
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-901825">T-T-T</a>.</p>
<p>The command is attempting to filter and count the lines containing the string &#8220;<strong>01:19:21</strong>&#8221; in a text file or a stream of text.</p>
<pre>
$lines_of_text | grep 01:19:21
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ashley		</title>
		<link>https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1332077</link>

		<dc:creator><![CDATA[Ashley]]></dc:creator>
		<pubDate>Wed, 06 May 2020 16:12:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=2278#comment-1332077</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1155402&quot;&gt;Thomas&lt;/a&gt;.

The previous &lt;code&gt;cut &#124; grep &#124; wc&lt;/code&gt; still only counts lines, not word occurrences, and would consider &quot;&lt;strong&gt;anthem&lt;/strong&gt;,&quot; &quot;&lt;strong&gt;these&lt;/strong&gt;,&quot; etc matches for the substring &quot;&lt;strong&gt;the&lt;/strong&gt;.&quot;

This is a way to do what you want-
&lt;pre&gt;
# perl -lne &#039;$c += () = /\bthe\b/g; END{ print $c }&#039; YourFileGlob ListofFiles
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1155402">Thomas</a>.</p>
<p>The previous <code>cut | grep | wc</code> still only counts lines, not word occurrences, and would consider &#8220;<strong>anthem</strong>,&#8221; &#8220;<strong>these</strong>,&#8221; etc matches for the substring &#8220;<strong>the</strong>.&#8221;</p>
<p>This is a way to do what you want-</p>
<pre>
# perl -lne '$c += () = /\bthe\b/g; END{ print $c }' YourFileGlob ListofFiles
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ravi Saive		</title>
		<link>https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1155424</link>

		<dc:creator><![CDATA[Ravi Saive]]></dc:creator>
		<pubDate>Tue, 21 May 2019 04:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=2278#comment-1155424</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1155402&quot;&gt;Thomas&lt;/a&gt;.

@Thomas,

To count occurrence of word in Linux text file, you should use following command.
&lt;pre&gt;
# cut -f 1 filename &#124; grep -i &quot;Yourword&quot; &#124; wc -l
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1155402">Thomas</a>.</p>
<p>@Thomas,</p>
<p>To count occurrence of word in Linux text file, you should use following command.</p>
<pre>
# cut -f 1 filename | grep -i "Yourword" | wc -l
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thomas		</title>
		<link>https://www.tecmint.com/wc-command-examples/comment-page-1/#comment-1155402</link>

		<dc:creator><![CDATA[Thomas]]></dc:creator>
		<pubDate>Tue, 21 May 2019 03:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=2278#comment-1155402</guid>

					<description><![CDATA[Is there a way to see how many times the word &#039;the&#039; was used?]]></description>
			<content:encoded><![CDATA[<p>Is there a way to see how many times the word &#8216;the&#8217; was used?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
