从任何Linux命令输出中省略第一行 [英] Omitting the first line from any Linux command output

查看:1175
本文介绍了从任何Linux命令输出中省略第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要从ls -latr "some path"输出中省略第一行的要求,因为我需要从下面的输出中删除total 136

I have a requirement where i'd like to omit the 1st line from the output of ls -latr "some path" Since I need to remove total 136 from the below output

所以我写了ls -latr /home/kjatin1/DT_901_linux//autoInclude/system | tail -q,其中排除了第一行,但是当文件夹为空时,它不会忽略它.请告诉我如何在任何Linux命令输出中省略第一行

So I wrote ls -latr /home/kjatin1/DT_901_linux//autoInclude/system | tail -q which excluded the 1st line, but when the folder is empty it does not omit it. Please tell me how to omit 1st line in any linux command output

推荐答案

将其放置到awk:

awk '{if(NR>1)print}'

sed

sed -n '1!p'

这篇关于从任何Linux命令输出中省略第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆