从第3行开始,一共显示5行。即显示3~8行

cat bblayers.conf | tail -n +3 | head -n 5

 

 1 etouch@etouch-T410:~/work-hanrp/rcarm3/linux/Renesas/build/conf$ cat bblayers.conf 
 2 # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
 3 # changes incompatibly
 4 POKY_BBLAYERS_CONF_VERSION = "2"
 5 
 6 BBPATH = "${TOPDIR}"
 7 BBFILES ?= ""
 8 
 9 BBLAYERS ?= " \
10   ${TOPDIR}/../poky/meta \
11   ${TOPDIR}/../poky/meta-poky \
12   ${TOPDIR}/../poky/meta-yocto-bsp \
13   ${TOPDIR}/../meta-renesas/meta-rcar-gen3 \
14   ${TOPDIR}/../meta-openembedded/meta-oe \
15   ${TOPDIR}/../meta-linaro/meta-optee \
16   "
17 etouch@etouch-T410:~/work-hanrp/rcarm3/linux/Renesas/build/conf$ cat bblayers.conf | tail -n +3 | head -n 5
18 POKY_BBLAYERS_CONF_VERSION = "2"
19 
20 BBPATH = "${TOPDIR}"
21 BBFILES ?= ""
22 
23 etouch@etouch-T410:~/work-hanrp/rcarm3/linux/Renesas/build/conf$

 

分解:

    tail -n 1000:显示最后1000行

    tail -n +1000:从1000行开始显示,显示1000行以后的

    head -n 1000:显示前面1000行

 

参考:https://www.cnblogs.com/suanec/p/5881463.html