Using awk to select one field

Hi,
I saw your post..
I have a dought in awk command...

how to get the output from a file. i need a first column in etc/passwd file in a single column (in indivijual line)...
i couldn't get with this command

cat /etc/passwd | awk -F ":" '{printf $1}'

Kindly help

Please always start your own thread. Never hijack someone else's.

Use print instead of printf

awk -F ":" '{print $1}' /etc/passwd
1 Like

Or supply a format string to printf .

cat /etc/passwd | awk -F":" '{ print $1 | "sort"}'