![linux命令-head - 小庄 - 苦海无边](http://img1.ph.126.net/AUYWJor1jvpHFQyAuuE4tw==/2583940286221826548.png)
wj@Vostro:~$ head -c5 /etc/passwd
root:
wj@Vostro:~$ head -c40 /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x
wj@Vostro:~$ head -5 /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
wj@Vostro:~$ awk -F : 'FNR<=5' /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
wj@Vostro:~$ sed -n '1,5p' /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync