use*_*456 1 text-processing columns text-formatting
我在不同的文件中有 2 个文本file1
和file2
. 我需要一个将file1
和file2
作为参数并在终端上打印的命令
This is text 1. This is This is text 2. This is
text 1.This is text 1. This text 2.This is text 2. This
is text 1. This is text 1. is text 2. This is text 2.
This is text 1. This is text 2.
Run Code Online (Sandbox Code Playgroud)
对于大小为 10 的 20 个字符的列
paste <(fold file1 -w 10) <(fold file2 -sw 10) | pr -t -e20
Run Code Online (Sandbox Code Playgroud)
fold
选项
-w
是列宽-s
避免将单词逐行分开pr
选项
-t
导致省略页眉和页脚(日期、时间和页码)-eN
设置N
为替换由产生的制表符的空格数paste