在 Linux 粘贴命令中对齐输出

Met*_*ild 4 linux columns output

无论第一个文件中的行长度如何,如何使粘贴中的第二个文件在同一位置开始?例如:

file1:
small
incredibly humungous

file 2:
A
B
Run Code Online (Sandbox Code Playgroud)

我想粘贴 file1 file2 来输出:

small                        A
incredibly humungous         B
Run Code Online (Sandbox Code Playgroud)

代替:

small                        A
incredibly humungous                        B
Run Code Online (Sandbox Code Playgroud)

Siv*_*iva 6

我们可以使用column命令 withtab作为分隔符。

paste file1 file2 | column -s $'\t' -t

small                 A
incredibly humungous  B
Run Code Online (Sandbox Code Playgroud)