How to remove all white spaces from a given text file

前端 未结 11 1843
无人共我
无人共我 2020-12-13 01:34

I want to remove all the white spaces from a given text file. Is there any shell command available for this ? Or, how to use sed for this purpose.

I wa

11条回答
  •  春和景丽
    2020-12-13 02:10

    I think you may use sed to wipe out the space while not losing some infomation like changing to another line.

    cat hello.txt | sed '/^$/d;s/[[:blank:]]//g'
    

提交回复
热议问题