首页 > 试题广场 >

在 Linux 中,如何将以下 test 文本中多余的空格合

[单选题]
在 Linux 中,如何将以下 test 文本中多余的空格合并()
合并前 test 内容
Niuniu       niu niu            niu  niuniu
合并后 test 内容
Niuniu niu niu niu niuniu
  • sed -r 's/ {2,}/ /g' test
  • sed '=' test | sed 'N;s/\n/\t/'
  • awk '$1=$0' test
  • sed -r 's/ {3, }/ /g' test

这道题你会答吗?花几分钟告诉大家答案吧!