用sed命令模拟tac
程序员文章站
2022-03-04 17:53:36
...
原始数据
This is the header line.
This is the first data line.
This is the second data line.
This is the last line.
This is the last line.
This is the second data line.
This is the first data line.
This is the header line.
This is the last line.
This is the second data line.
This is the first data line.
This is the header line.
cat data
This is the header line.
This is the first data line.
This is the second data line.
This is the last line.
tac data
This is the last line.
This is the second data line.
This is the first data line.
This is the header line.
sed -n '{1!G;h;$p}' data
This is the last line.
This is the second data line.
This is the first data line.
This is the header line.
上一篇: spring整合quartz定时任务
下一篇: 有一次我出差在大排档吃饭