unix 列命令中的“在行之前填充列”选项

bal*_*lki 3 columns

根据 man column

 -x      Fill columns before filling rows.
Run Code Online (Sandbox Code Playgroud)

这个选项似乎没有任何作用。知道如何使用它吗?

iru*_*var 5

这与-c Output is formatted for a display columns wide.选项有关。最好用一个例子来解释

cat test.file2
1 a b c d e f g h
2 a b c d e f g h
3 a b c d e f g h
4 a b c d e f g h
5 a b c d e f g h
6 a b c d e f g h
Run Code Online (Sandbox Code Playgroud)

当输出被格式化为显示 80 列宽时,首先column填充行

column -c 80 test.file2 
1 a b c d e f g h       3 a b c d e f g h       5 a b c d e f g h
2 a b c d e f g h       4 a b c d e f g h       6 a b c d e f g h
Run Code Online (Sandbox Code Playgroud)

When the -x Fill columns before filling rows.option is passed, the opposite happens

column -c 80 -x test.file2 
1 a b c d e f g h       2 a b c d e f g h       3 a b c d e f g h
4 a b c d e f g h       5 a b c d e f g h       6 a b c d e f g h
Run Code Online (Sandbox Code Playgroud)


Run*_*ium 5

填充顺序:

$ cat col
01 02 03 04 05 06 07
08 09 10 11 12 13 14 
15 16 17 18 19 20 21 
22 23 24 25 26 27 28 
29 30 31 32

$ column col
01 02 03 04 05 06 07    15 16 17 18 19 20 21    29 30 31 32
08 09 10 11 12 13 14    22 23 24 25 26 27 28 

$ column -x col
01 02 03 04 05 06 07    08 09 10 11 12 13 14    15 16 17 18 19 20 21 
22 23 24 25 26 27 28    29 30 31 32
Run Code Online (Sandbox Code Playgroud)

这也会影响行/列数:

$ column col
01 02 03 04    13 14 15 16    25 26 27 28    37 38 39 40
05 06 07 08    17 18 19 20    29 30 31 32    41
09 10 11 12    21 22 23 24    33 34 35 36

$ column -x col
01 02 03 04    05 06 07 08    09 10 11 12    13 14 15 16    17 18 19 20 
21 22 23 24    25 26 27 28    29 30 31 32    33 34 35 36    37 38 39 40
41
Run Code Online (Sandbox Code Playgroud)