Skip to content

Text processing

6 min

cut, and what it will not do

Fields, and the line with no delimiter.

cut -d: -f2 takes the second colon-separated field. It never reorders: -f2,1 and -f1,2 produce the same thing, in field order.

A line with no delimiter at all is printed whole by default, which is the behaviour that makes cut look broken on a file with a header or a blank line. -s skips those lines instead.

Try this

$

Files

The files in the sandbox, with their modes, link counts and sizes
ModeLinksSizeName
-rw-r--r--1796app.log
-rw-r--r--1396app.log.1