User's manual. Section 1.

FLDS(1): print fields


USAGE

DESCRIPTION

Flds prints the requested fields for the given files. Fields are specified as ranges. A range may be a single line number, counting from 1, or a pair of start and end field numbers separated by a "," character. Negative field numbers count backwards from the end of the line (the last is -1 and so on).

Multiple ranges may be given. A missing start number in a range means 1, and a missing end number in a range means -1. If no range is given, "," is implied. And, when such range is indicated, all fields are printed, one line at a time.

By default the field separator is a run of blanks. Flag -F changes the set of runes used as field separators to its argument.

Flag -1 indicates that fields are separated exactly by one instance of the separator string. Such string defaults to a tabulator character in this case, unless -F says otherwise.

Fields are printed in the order indicated by the ranges given (first range gets printed first). Output fields are separated by default using a tab character or the sep string if -1 is used.

EXAMPLES

Print the first two fields and the last one from the ps output:

In a file with fields separated with ":", and, perhaps with empty fields, print just the first and third fields in reverse order:

Replace the field separator ":" with "," in all files under the current directory and update those files on disk:

SOURCE


User's manual. Section 1.