*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> cut (1)              
Title
Content
Arch
Section
 

Contents


cut(1)									cut(1)


NAME    [Toc]    [Back]

     cut - cut out selected fields of each line	of a file

SYNOPSIS    [Toc]    [Back]

     cut -b list [-n] [file . .	.]
     cut -c list <b>[file <b>...]
     cut -f list [-d char] [-s]	[file .	. .]

DESCRIPTION    [Toc]    [Back]

     Use cut to	cut out	columns	from a table or	fields from each line of a
     file; in data base	parlance, it implements	the projection of a relation.
     The fields	as specified by	list can be fixed length, that is, character
     positions as on a punched card (-c	option)	or the length can vary from
     line to line and be marked	with a field delimiter character like tab (-f
     option).  cut can be used as a filter; if no files	are given, the
     standard input is used.  A	file name of ``-'' explicitly refers to
     standard input.

     cut processes supplementary code set characters, and recognizes
     supplementary code	set characters in the char given to the	-d option (see
     below) according to the locale specified in the LC_CTYPE environment
     variable [see LANG	on environ(5)].	 For special treatment of multibyte
     characters, see the -clist	option below.

     The meanings of the options are:

     list     A	comma-separated	list or	blank-separated	list of	positive
	      numbers and ranges.  Ranges have three forms.  The first is two
	      positive integers	separated by a hyphen (low-high), which
	      represents all fields from low to	high.  The second is a
	      positive number preceded by a hyphen (-high), which represents
	      all fields from field 1 to high.	The last is a positive number
	      followed by a hyphen (low-), which represents all	fields from
	      low to the last field, inclusive.	 Elements in the list can be
	      repeated,	can overlap, and can appear in any order.

     -b	list  Cut based	on a list of bytes.  Each selected byte	will be	output
	      unless the -n option is also specified.  Bytes specified need
	      not be present in	the input.

     -c	list  Cut based	on a list of characters.  Each selected	character will
	      be output.  Characters specified need not	be present in the
	      input.

     -d	      The character following -d is the	field delimiter	(-f option
	      only).  Default is tab.  Space or	other characters with special
	      meaning to the shell must	be quoted.  char may be	a
	      supplementary code set character.

     -flist   The list following -f is a list of fields	assumed	to be
	      separated	in the file by a delimiter character (see -d );	for
	      example, -f1,7 copies the	first and seventh field	only.  Lines



									Page 1






cut(1)									cut(1)



	      with no field delimiters will be passed through intact (useful
	      for table	subheadings), unless -s	is specified.  Fields
	      specified	need not be present in the input.

     -n	      Do not split characters.	When specified with the	-b option, all
	      characters ending	within the range are passed to the output.

     -s	      Suppresses lines with no delimiter characters in case of -f
	      option.  Unless specified, lines with no delimiters will be
	      passed through untouched.

     Either the	-c or -f option	must be	specified.

     Use grep(1) to make horizontal ``cuts'' (by context) through a file, or
     paste(1) to put files together column-wise	(that is, horizontally).  To
     reorder columns in	a table, use cut and paste.

EXAMPLES    [Toc]    [Back]

     cut -d: -f1,5 /etc/passwd
			   mapping of user IDs to names

     name=`who am i | cut -f1 -d" "`
			   to set name to current login	name.

FILES    [Toc]    [Back]

     /usr/lib/locale/locale<b>/LC_MESSAGES/uxcore
	  language-specific message file [See LANG on environ(5).]

EXTENDED DESCRIPTION    [Toc]    [Back]

     X/Open CAE	Specification(1994)--Commands and Utilities.

SEE ALSO    [Toc]    [Back]

      
      
     grep(1), paste(1)

DIAGNOSTICS    [Toc]    [Back]

     UX:cut:ERROR:line too long
		 A line	can have no more than 1023 bytes or fields, or there
		 is no new-line	character.

     UX:cut:ERROR:bad list for c/f option
		 Missing -c or -f option or incorrectly	specified list.	 No
		 error occurs if a line	has fewer fields than the list calls
		 for.

     UX:cut:ERROR:no fields
		 The list is empty.

     UX:cut:ERROR:no delimiter
		 Missing char on -d option.






									Page 2






cut(1)									cut(1)



     UX:cut:ERROR:cannot handle	multiple adjacent backspaces
		 Adjacent backspaces cannot be processed correctly.

     UX:cut:WARNING:cannot open	<filename<b>>
		 Either	filename cannot	be read	or does	not exist.  If
		 multiple filenames are	present, processing continues.


									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
cut HP-UX cut out (extract) selected fields of each line of a file
ypchpass IRIX change selected NIS passwd fields
edit Tru64 Edits a file line by line with a simplified command set
e Tru64 Edits a file line by line
ed Tru64 Edits a file line by line
red Tru64 Edits a file line by line
odump Tru64 Dumps selected parts of an object file
SelectSaver IRIX save and restore selected file handle
odump IRIX dumps selected parts of an object file
elfdump IRIX dumps selected parts of a 32-bit or a 64-bit ELF object file/archive and displays them in ELF style
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service