Print columns with awk

Print the 1st and 3rd fields of each line. By default awk splits on spaces, so for /etc/passwd you need -F: to split on colons.

awk '{print $1, $3}' /etc/passwd

tool
linux133 commands
tags
linux

More linux commands

all 133 linux commands