
에 따르면 man column
:
-x Fill columns before filling rows.
이 옵션은 아무 것도 하지 않는 것 같습니다. 어떻게 사용하는지 아시나요?
답변1
이것은 옵션과 함께 작동합니다 -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
출력이 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
옵션이 전달 되면 -x Fill columns before filling rows.
반대 현상이 발생합니다.
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
답변2
채우는 순서:
$ 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
행/열 수에도 영향을 미칠 수 있습니다.
$ 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