<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Cut_%28Unix%29</id>
	<title>Cut (Unix) - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Cut_%28Unix%29"/>
	<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Cut_(Unix)&amp;action=history"/>
	<updated>2026-07-11T21:47:52Z</updated>
	<subtitle>在这个wiki上该页的修订历史</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://arolstar52-zhtest.hf.space/index.php?title=Cut_(Unix)&amp;diff=452479&amp;oldid=prev</id>
		<title>imported&gt;Raymon090：​// Edit via WikiMirror</title>
		<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Cut_(Unix)&amp;diff=452479&amp;oldid=prev"/>
		<updated>2022-09-26T09:06:24Z</updated>

		<summary type="html">&lt;p&gt;// Edit via &lt;a href=&quot;/index.php?title=W:zh:WP:MF&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;W:zh:WP:MF（页面不存在）&quot;&gt;WikiMirror&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{noteTA&lt;br /&gt;
|G1=IT&lt;br /&gt;
}}&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
在電腦使用上，&amp;#039;&amp;#039;&amp;#039;cut&amp;#039;&amp;#039;&amp;#039;是一種[[Unix]][[命令行界面|命令行]]程式。它常用來截取每行輸入──通常是[[電腦檔案|檔案]]──的片段。&lt;br /&gt;
&lt;br /&gt;
一般截取行片段可以透過[[位元]]（&amp;lt;code&amp;gt;-b&amp;lt;/code&amp;gt;）、[[字符]]、或者以分隔字符（&amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt;—預設為[[製表鍵|跳位字元]]）分隔的欄位（&amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt;）達成。每次做截取都必須給定範圍，包括下面四種之一：&amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;N-M,&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;N-&amp;lt;/code&amp;gt;（&amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;到行尾），或者&amp;lt;code&amp;gt;-M&amp;lt;/code&amp;gt;（行頭到&amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;）。&lt;br /&gt;
&lt;br /&gt;
== 範例 ==&lt;br /&gt;
&lt;br /&gt;
假設一個檔案名叫 &amp;#039;&amp;#039;&amp;#039;file&amp;#039;&amp;#039;&amp;#039; 包含下面數行：&lt;br /&gt;
&lt;br /&gt;
 foo:bar:baz:qux:quux&lt;br /&gt;
 one:two:three:four:five:six:seven&lt;br /&gt;
 alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu&lt;br /&gt;
&lt;br /&gt;
輸出每行第四到第十字元就是：&lt;br /&gt;
&lt;br /&gt;
 % cut -c 4-10 file&lt;br /&gt;
&lt;br /&gt;
輸出結果：&lt;br /&gt;
&lt;br /&gt;
 :bar:ba&lt;br /&gt;
 :two:th&lt;br /&gt;
 ha:beta&lt;br /&gt;
&lt;br /&gt;
使用冒號當欄位分隔字元輸出第五欄到每行行尾：&lt;br /&gt;
&lt;br /&gt;
 % cut -d : -f 5- file&lt;br /&gt;
&lt;br /&gt;
輸出結果：&lt;br /&gt;
&lt;br /&gt;
 quux&lt;br /&gt;
 five:six:seven&lt;br /&gt;
 epsilon:zeta:eta:teta:iota:kappa:lambda:mu&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
  cut [-b] [-c] [-f list] [-n] [-d delim] [-s] [file]&lt;br /&gt;
&lt;br /&gt;
Flags which may be used include &lt;br /&gt;
&lt;br /&gt;
; -b : Bytes; a list following -b specifies a range of [[byte]]s which will be returned, e.g. cut -b1-66 would return the first 66 bytes of a line. NB If used in conjunction with -n, no [[multi-byte]] characters will be split. NNB. -b will only work on input lines of less than 1023 bytes&lt;br /&gt;
; -c : Characters; a list following -c specifies a range of characters which will be returned, e.g. cut -c1-66 would return the first 66 characters of a line&lt;br /&gt;
; -f : Specifies a field list, separated by a [[delimiter]]&lt;br /&gt;
; list : A comma separated or blank separated list of integer denoted fields, incrementally ordered. The - indicator may be supplied as shorthand to allow inclusion of ranges of fields e.g. &amp;#039;&amp;#039;4-6&amp;#039;&amp;#039; for ranges 4–6 or &amp;#039;&amp;#039;5-&amp;#039;&amp;#039; as shorthand for field 5 to the end, etc.&lt;br /&gt;
; -n : Used in combination with -b suppresses splits of [[multi-byte character]]s&lt;br /&gt;
; -d : Delimiter; the character immediately following the -d option is the field delimiter for use in conjunction with the -f option; the default delimiter is &amp;#039;&amp;#039;tab&amp;#039;&amp;#039;. Space and other characters with special meanings within the context of the [[Unix shell|shell]] in use must be enquoted or escaped as necessary.&lt;br /&gt;
; -s : Bypasses lines which contain no field delimiters when -f is specified, unless otherwise indicated.&lt;br /&gt;
; file : The file (and accompanying path if necessary) to process as input. If no file is specified then [[standard input]] will be used.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 參見 ==&lt;br /&gt;
* [[Unix实用程序列表]]&lt;br /&gt;
* [[grep]]&lt;br /&gt;
* [[paste (Unix)|paste]]&lt;br /&gt;
&lt;br /&gt;
== 外部連結 ==&lt;br /&gt;
* [http://www.softpanorama.org/Tools/cut.shtml Softpanorama cut page]{{Wayback|url=http://www.softpanorama.org/Tools/cut.shtml |date=20130518002631 }}.&lt;br /&gt;
* {{man|1|cut||remove sections from each line of files}}&lt;br /&gt;
&lt;br /&gt;
{{Unix命令}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Unix文字处理实用工具]]&lt;br /&gt;
[[Category:标准Unix程序]]&lt;br /&gt;
[[Category:Unix SUS2008实用工具]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Raymon090</name></author>
	</entry>
</feed>