sed 将多行文件变为一行

来源:互联网 发布:windows 注册表 编辑:程序博客网 时间:2024/05/17 21:40


head ./com.txt | sed ':a;N;s/\n/XXXXX/g;ta' | od -c


例:

[root@local]# seq 1 5 | sed ':a;N;s/\n/:/;ta'
1:2:3:4:5


查看文件存储编码:


head a.txt | od -c 

原创粉丝点击