查看文件的某一行

author:headsen  chen

date :2018-10-09  18:00:25

1,方法一:用sed

[root@a chen]# sed -n '10p' ne2
1098.50 7287d7

2,方法二:用head

[root@a chen]# head -n 10 ne2 |tail -1
1098.50 7287d7

扩展:查看文件的第10行到20行内容

[root@a chen]# sed -n '10,20p' ne2
98.50 7287d7
97.38 7287d7
97.37 7287d7
98.48 59800a
98.47 81814f
97.36 81814f
98.46 81814f
94.99 752cf3
94.100 bcb62a
94.11 bcb62a
94.101 bcb62a

猜你喜欢

转载自www.cnblogs.com/kaishirenshi/p/9761898.html