linux下怎么把一行数据变成一列?
用xargs -n1
格式:
echo XXX XXX XXX |xargs -n1
[root@zabbix ~]# echo the squid project provides a number of resources toassist users design|xargs -n1
the
squid
project
provides
a
number
of
resources
toassist
users
design
并且xargs可以去掉换行符
怎么把一列数据变为一行?
格式:
xxxx(你的命令)| xargs
[root@zabbix ~]# cat lie.txt
of
resources
toassist
users
design,implement
and
support
squid
[root@zabbix ~]# cat lie.txt |xargs
of resources toassist users design,implement and support squid