Having used Unix since before "cut" was apt to be on the machine, I'm used to using "sed" to extract what I want from a line, but "cut" is much easier:
apl$ cut -d : -f 5 /etc/passwd Unprivileged User System Administrator System Services Unknown User Sendmail User World Wide Web Server MySQL Server sshd Privilege separation Anthony Lawrence
Now that's not fun with sed.
Cut can also use character positions:
cut -c 1-8 /etc/passwd nobody:* root:*:0 daemon:* unknown: smmsp:*: www:*:70 mysql:*: sshd:*:7 apl:*:50
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
Inexpensive and informative Apple related e-books:
Take Control of the Mac Command Line with Terminal, Second Edition
Take control of Apple TV, Second Edition
Take Control of Numbers
Take Control of Automating Your Mac
Are Your Bits Flipped?