$ awk '{printf "%6d %s\n",NR,$0}' /etc/issue 1 Asianux release 1.0 (koumei) 2 Kernel \r on an \m 3
$ awk '{printf "%6d/%d %s\n",FNR,NR,$0}' /etc/hosts /etc/exports 1/1 # Do not remove the following line, or various programs 2/2 # that require network functionality will fail. 3/3 127.0.0.1 localhost.localdomain localhost 4/4 172.16.0.99 www.yakoshi.la.net h099.s19.la.net h099 1/5 # 2/6 /export *(async) 3/7 /tmp *(rw,async) 4/8 /mnt/nfs 172.16.0.0/255.255.0.0(rw,async)
$ awk 'NR<=5' /etc/printcap # /etc/printcap # # Please don't edit this file directly unless you know what you are doing! # Be warned that the control-panel printtool requires a very strict format! # Look at the printcap(5) man page for more info.
$ grep ^[a-z] /etc/printcap $ awk '/^[a-z]/' /etc/printcap dumb|80-column dumb tty:\ unknown|unknown terminal type:\ lpr|printer|line printer:\ glasstty|classic glass tty interpreting ASCII control characters:\ vanilla:\ ansi+local1:\ ansi+local:\ ansi+tabs:\ ansi+inittabs:\ ansi+erase:\
$ awk -F: '{print $1 | "sort"}' /etc/passwd adm apache bin canna daemon desktop ftp
$ awk -F: '$4==0' /etc/passwd root:x:0:0:root:/root:/bin/bash sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt operator:x:11:0:operator:/root:/sbin/nologin