⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cut.1

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 1
字号:
.\" SCCSID: @(#)cut.1	8.2	1/25/91.if t .ds ' \h@.05m@\s+4\v@.333m@\'\v@-.333m@\s-4\h@.05m@.if n .ds ' '.if t .ds ` \h@.05m@\s+4\v@.333m@\`\v@-.333m@\s-4\h@.05m@.if n .ds ` `.TH cut 1.SH Namecut \- cut out selected fields of each line of a file.SH Syntax\fBcut \-c\fR\fIlist\fR [\|\fIfile1 file2...\fR].br\fBcut \-f\fR\fIlist\fR [\fB\-d\fIchar\fR\|] [\fB\-s\fR] [\|\fIfile1 file2...\fR].SH Description.NXR "cut command".NXR "file" "cutting fields from".NXA "grep command" "cut command".NXA "cut command" "paste command"Use the.PN cutcommandto cut out columns from a table or fields from each line of a file.  The fields as specified by.I list\^can be fixed length,that is, character positions as on a punched card(\fB\-c\fP option), or the length can vary from line to lineand be marked with a field delimiter character like.I tab\^(\fB\-f\fP option).The.PN cutcommand can be used as a filter.If no files are given, the standard input is used..PPUse.MS grep 1to make horizontal ``cuts''(by context) through a file, or.MS paste 1to put files together in columns.To reorder columns in a table, use.PN cutand.PN paste ..SH Options.NXR "cut command" "options".TP 12.I listSpecifies ranges that must be acomma-separated list of integer field numbers in increasing order.With optional \fB\-\fP indicates rangesas in the .B \-ooption ofnroff/trofffor page ranges;for example,.BR 1,4,7 ;.BR 1\-3,8 ;.B \-5,10(short for \fB1\-5,10\fP); or.B 3\-(short for third through last field)..TP.BI \-c listSpecifies characterpositions to be cut out. For example,.B \-c1\-72would pass the first 72 charactersof each line..TP.BI \-f listSpecifies the fields to be cut out.For example,.B \-f1,7copies the first and seventh field only.Lines with no field delimiters are passed through intact (usefulfor table subheadings), unless .B \-sis specified..TP.BI \-d charUses the specified character as the field delimiter.  Default is.IR tab .Space or other characters withspecial meaning to the shell must be quoted.The \fB\-d\fP option is used only in combination with the \fB\-f\fP option, according to XPG3 and SVID2/SVID3..TP.B \-sSuppresses lines with no delimiter characters.   Unless specified, lines with no delimiters are passed through untouched.  Either the.B \-cor .B \-foption must be specified..SH ExamplesMapping of user \s-1ID\s0s to names:.EX 5cut \-d: \-f1,5 /etc/passwd.EETo set .B nameto the current loginname for the csh shell:.EX 5set name=`who am i | cut \-f1 \-d" "\*`.EETo set .B nameto the current loginname for the sh, sh5, and ksh shells:.EX 5name=`who am i | cut \-f1 \-d" "\*`.EE.SH Diagnostics.TP 20"line too long\^"A line can have no more than 511 characters or fields..TP"bad list for c\|/\|f option\^"Missing .B \-cor .B \-foption or incorrectly specified.IR list .No error occurs if a line has fewer fields than the.I list\^calls for..TP"no fields\^"The.I list\^is empty..SH See Alsogrep(1), paste(1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -