@@ -2268,81 +2268,6 @@ <h2 id="options-17"><a class="header" href="#options-17">Options</a></h2>
2268
2268
</ dl >
2269
2269
< p > Each call must specify a mode (what to use for columns),
2270
2270
a sequence (which columns to print), and provide a data source</ p >
2271
- < p > Specifying a mode</ p >
2272
- < pre > < code > Use --bytes (-b) or --characters (-c) to specify byte mode
2273
-
2274
- Use --fields (-f) to specify field mode, where each line is broken into
2275
- fields identified by a delimiter character. For example for a typical CSV
2276
- you could use this in combination with setting comma as the delimiter
2277
- </ code > </ pre >
2278
- < p > Specifying a sequence</ p >
2279
- < pre > < code > A sequence is a group of 1 or more numbers or inclusive ranges separated
2280
- by a commas.
2281
-
2282
- cut -f 2,5-7 some_file.txt
2283
- will display the 2nd, 5th, 6th, and 7th field for each source line
2284
-
2285
- Ranges can extend to the end of the row by excluding the the second number
2286
-
2287
- cut -f 3- some_file.txt
2288
- will display the 3rd field and all fields after for each source line
2289
-
2290
- The first number of a range can be excluded, and this is effectively the
2291
- same as using 1 as the first number: it causes the range to begin at the
2292
- first column. Ranges can also display a single column
2293
-
2294
- cut -f 1,3-5 some_file.txt
2295
- will display the 1st, 3rd, 4th, and 5th field for each source line
2296
-
2297
- The --complement option, when used, inverts the effect of the sequence
2298
-
2299
- cut --complement -f 4-6 some_file.txt
2300
- will display the every field but the 4th, 5th, and 6th
2301
- </ code > </ pre >
2302
- < p > Specifying a data source</ p >
2303
- < pre > < code > If no sourcefile arguments are specified, stdin is used as the source of
2304
- lines to print
2305
-
2306
- If sourcefile arguments are specified, stdin is ignored and all files are
2307
- read in consecutively if a sourcefile is not successfully read, a warning
2308
- will print to stderr, and the eventual status code will be 1, but cut
2309
- will continue to read through proceeding sourcefiles
2310
-
2311
- To print columns from both STDIN and a file argument, use - (dash) as a
2312
- sourcefile argument to represent stdin.
2313
- </ code > </ pre >
2314
- < p > Field Mode options</ p >
2315
- < pre > < code > The fields in each line are identified by a delimiter (separator)
2316
-
2317
- Set the delimiter
2318
- Set the delimiter which separates fields in the file using the
2319
- --delimiter (-d) option. Setting the delimiter is optional.
2320
- If not set, a default delimiter of Tab will be used.
2321
-
2322
- If the -w option is provided, fields will be separated by any number
2323
- of whitespace characters (Space and Tab). The output delimiter will
2324
- be a Tab unless explicitly specified. Only one of -d or -w option can be specified.
2325
- This is an extension adopted from FreeBSD.
2326
-
2327
- Optionally Filter based on delimiter
2328
- If the --only-delimited (-s) flag is provided, only lines which
2329
- contain the delimiter will be printed
2330
-
2331
- Replace the delimiter
2332
- If the --output-delimiter option is provided, the argument used for
2333
- it will replace the delimiter character in each line printed. This is
2334
- useful for transforming tabular data - e.g. to convert a CSV to a
2335
- TSV (tab-separated file)
2336
- </ code > </ pre >
2337
- < p > Line endings</ p >
2338
- < pre > < code > When the --zero-terminated (-z) option is used, cut sees \0 (null) as the
2339
- 'line ending' character (both for the purposes of reading lines and
2340
- separating printed lines) instead of \n (newline). This is useful for
2341
- tabular data where some of the cells may contain newlines
2342
-
2343
- echo 'ab\0cd' | cut -z -c 1
2344
- will result in 'a\0c\0'
2345
- </ code > </ pre >
2346
2271
< h2 id ="examples-16 "> < a class ="header " href ="#examples-16 "> Examples</ a > </ h2 >
2347
2272
< p > Print a specific character/field range of each line:</ p >
2348
2273
< pre > < code class ="language-shell "> {{command}} | cut --{{characters|fields}}={{1|1,10|1-10|1-|-10}}
@@ -9649,7 +9574,7 @@ <h2 id="examples-101"><a class="header" href="#examples-101">Examples</a></h2>
9649
9574
</ div >
9650
9575
< pre > < code > users [FILE]
9651
9576
</ code > </ pre >
9652
- < p > Print the user names of users currently logged in to the current host</ p >
9577
+ < p > Print the user names of users currently logged in to the current host. </ p >
9653
9578
< h2 id ="options-112 "> < a class ="header " href ="#options-112 "> Options</ a > </ h2 >
9654
9579
< dl > < dt > </ dt >
9655
9580
< dd >
0 commit comments