我把这个放在一行中:
We were born in the earth beyond the land
我希望它在 3 个单词行中,像这样:
We were born
in the earth
beyond the land
最佳答案
$ xargs -n3 < file
We were born
in the earth
beyond the land
$ egrep -o '\S+\s+\S+\s+\S+' file
We were born
in the earth
beyond the land
关于linux - 如何使用 AWK 或 Sed 在 x 个单词后插入换行符\n,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15979802/