Shell Removing Tabs/Spaces

前端 未结 6 1592
醉酒成梦
醉酒成梦 2021-02-20 18:45

I\'ve used a grep command with sed and cut filters that basically turns my output to something similar to this

    this line 1


    this line 2


    another li         


        
6条回答
  •  轮回少年
    2021-02-20 18:58

    I would do this, short and simple:

    sed 's: ::g'
    

    Add this at the end of your command, and all whitespace will go poof. For example try this command:

    cat /proc/meminfo | sed 's: ::g'
    

提交回复
热议问题