sed 格式化输出df -h

df -h|sed '1d;/ /!N;s/\n//;s/ \+/ /;'

sed 格式化输出df -h

1d——————删除第一行
/ /!N——————没有空格的行执行N
例子中没有空格的行
/dev/mapper/vg_dsidealyy-lv_root/dev/mapper/vg_dsidealyy-lv_home
s/\n//——————pattern空间内的换行替换为空格
s/ \+/ /——————N多空格替换为一个空格

 

相关文章:

  • 2021-07-21
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2022-01-01
相关资源
相似解决方案