<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>行數統計 &#8211; 21點情報網</title>
	<atom:link href="https://ailog.tw/lifelog/tag/%E8%A1%8C%E6%95%B8%E7%B5%B1%E8%A8%88/feed/" rel="self" type="application/rss+xml" />
	<link>https://ailog.tw/lifelog</link>
	<description></description>
	<lastBuildDate>Sun, 19 Mar 2023 05:48:05 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Linux透過「wc」指令計算檔案或管道輸出的行數、字數、位元組數</title>
		<link>https://ailog.tw/lifelog/2023/03/19/linux-wc/</link>
		
		<dc:creator><![CDATA[blackjack]]></dc:creator>
		<pubDate>Sun, 19 Mar 2023 05:46:40 +0000</pubDate>
				<category><![CDATA[3C資訊]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[wc]]></category>
		<category><![CDATA[行數統計]]></category>
		<guid isPermaLink="false">https://ailog.tw/lifelog/?p=15322</guid>

					<description><![CDATA[今天小編要來介紹Linux系統中常用的wc指令，來統計檔案的行數或其他應用，一起來了解一下吧。 指令語法查詢： &#8230; <p class="link-more"><a href="https://ailog.tw/lifelog/2023/03/19/linux-wc/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux透過「wc」指令計算檔案或管道輸出的行數、字數、位元組數〉</span></a></p>]]></description>
										<content:encoded><![CDATA[<p><span style="font-family: verdana, geneva; font-size: 14pt;">今天小編要來介紹Linux系統中常用的wc指令，來統計檔案的行數或其他應用，一起來了解一下吧。</span></p>
<p><span style="font-family: verdana, geneva; font-size: 14pt;"><span id="more-15322"></span></span></p>
<p><span style="font-family: verdana, geneva; font-size: 14pt;">指令語法查詢：<br />
man wc</span></p>
<p><span style="font-family: verdana, geneva; font-size: 14pt;">指令語法：</span><br />
<span style="font-family: verdana, geneva; font-size: 14pt;">wc [OPTION] [FILE]<br />
wc 參數 檔案<br />
</span></p>
<p><span style="font-size: 14pt;">本範例使用的「/tmp/testfile.sh」檔案內容如下：</span><br />
<span style="font-size: 14pt;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
<span style="font-size: 14pt;">1</span><br />
<span style="font-size: 14pt;">22</span><br />
<span style="font-size: 14pt;">333</span><br />
<span style="font-size: 14pt;">4444</span><br />
<span style="font-size: 14pt;">55555</span><br />
<span style="font-size: 14pt;">666666</span><br />
<span style="font-size: 14pt;">7777777</span><br />
<span style="font-size: 14pt;">88888888</span><br />
<span style="font-size: 14pt;">999999999</span><br />
<span style="font-size: 14pt;">0000000000</span><br />
<span style="font-size: 14pt;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></p>
<p><span style="font-size: 14pt;"><strong><span style="color: #0000ff;">「-c」：&#8211;bytes</span></strong></span><br />
<span style="font-size: 14pt;">顯示「<span style="color: #ff0000;">位元數</span>」統計。</span><br />
<span style="font-size: 14pt;">範例：</span><br />
<span style="font-size: 14pt;">wc -c /tmp/testfile.sh<br />
<img fetchpriority="high" decoding="async" class="alignnone wp-image-15324 size-full" src="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-01.png" alt="" width="555" height="111" srcset="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-01.png 555w, https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-01-300x60.png 300w" sizes="(max-width: 555px) 100vw, 555px" /></span></p>
<p><span style="font-size: 14pt;"><strong><span style="color: #0000ff;">「-m」：&#8211;chars</span></strong></span><br />
<span style="font-size: 14pt;">顯示「<span style="color: #ff0000;">字元(character)</span>」數統計。</span><br />
<span style="font-size: 14pt;">範例：</span><br />
<span style="font-size: 14pt;">wc -m /tmp/testfile.sh<br />
<img decoding="async" class="alignnone wp-image-15325 size-full" src="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-02.png" alt="" width="566" height="120" srcset="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-02.png 566w, https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-02-300x64.png 300w" sizes="(max-width: 566px) 100vw, 566px" /><br />
</span></p>
<p><span style="font-size: 14pt;"><strong><span style="color: #0000ff;">「-l」：&#8211;lines</span></strong></span><br />
<span style="font-size: 14pt;">顯示「<span style="color: #ff0000;">行數</span>」統計。</span><br />
<span style="font-size: 14pt;">範例：</span><br />
<span style="font-size: 14pt;">wc -l /tmp/testfile.sh<br />
<img decoding="async" class="alignnone wp-image-15326 size-full" src="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-03.png" alt="" width="558" height="105" srcset="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-03.png 558w, https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-03-300x56.png 300w" sizes="(max-width: 558px) 100vw, 558px" /><br />
</span></p>
<p><span style="font-size: 14pt;"><strong><span style="color: #0000ff;">「-w」：&#8211;words</span></strong></span><br />
<span style="font-size: 14pt;">顯示「<span style="color: #ff0000;">字數(word)</span>」統計。</span><br />
<span style="font-size: 14pt;">範例：</span><br />
<span style="font-size: 14pt;">wc -w /tmp/testfile.sh<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-15327 size-full" src="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-04.png" alt="" width="563" height="119" srcset="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-04.png 563w, https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-04-300x63.png 300w" sizes="auto, (max-width: 563px) 100vw, 563px" /></span></p>
<p><span style="font-size: 14pt;"><strong><span style="color: #0000ff;">「-L」：&#8211;max-line-length</span></strong></span><br />
<span style="font-size: 14pt;">顯示「<span style="color: #ff0000;">最長的那一行的字數</span>」。</span><br />
<span style="font-size: 14pt;">範例：</span><br />
<span style="font-size: 14pt;">wc -L /tmp/testfile.sh<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-15329 size-full" src="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-06.png" alt="" width="561" height="117" srcset="https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-06.png 561w, https://ailog.tw/lifelog/wp-content/uploads/2023/03/linux-wc-06-300x63.png 300w" sizes="auto, (max-width: 561px) 100vw, 561px" /></span></p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
