"리눅스 col"의 두 판 사이의 차이

10번째 줄: 10번째 줄:
*탭 문자를 공백으로 변환하는 옵션
*탭 문자를 공백으로 변환하는 옵션
<source lang='cli'>
<source lang='cli'>
[root@zetawiki ~]# echo -e "my\tfriend" > 1.txt
root@zetawiki:~# echo -e "my\tfriend"
[root@zetawiki ~]# echo -e "my\tfriend" | col -x > 2.txt
</source>
<source lang='cli'>
[root@zetawiki ~]# cat 1.txt
my friend
my friend
[root@zetawiki ~]# cat 2.txt
root@zetawiki:~# echo -e "my\tfriend" | col -x
my      friend
my      friend
</source>
</source>
:→ 겉보기에는 차이가 없지만...
:→ 겉보기에는 차이가 없지만...
<source lang='cli'>
<source lang='cli'>
[root@zetawiki ~]# ll ?.txt
root@zetawiki:~# echo -e "my\tfriend" | wc -c
-rw-r--r-- 1 root root 10 Mar  8 00:18 1.txt
10
-rw-r--r-- 1 root root 15 Mar  8 00:18 2.txt
root@zetawiki:~# echo -e "my\tfriend" | col -x | wc -c
[root@zetawiki ~]# hexdump 1.txt
15
root@zetawiki:~# echo -e "my\tfriend" | hexdump
0000000 796d 6609 6972 6e65 0a64               
0000000 796d 6609 6972 6e65 0a64               
000000a
000000a
[root@zetawiki ~]# hexdump 2.txt
root@zetawiki:~# echo -e "my\tfriend" | col -x | hexdump
0000000 796d 2020 2020 2020 7266 6569 646e 000a
0000000 796d 2020 2020 2020 7266 6569 646e 000a
000000f
000000f
39번째 줄: 36번째 줄:
*[[리눅스 tbl]]
*[[리눅스 tbl]]
*[[리눅스 colcrt]]
*[[리눅스 colcrt]]
==주석==
<references/>


==참고 자료==
==참고 자료==

2016년 2월 6일 (토) 08:53 판

  다른 뜻에 대해서는 리눅스 column 문서를 참조하십시오.

1 개요

리눅스 col
/usr/bin/col
deprecated라고 하는데[1] CentOS 7에도 포함되어 있음

2 실습: -x 옵션

  • 탭 문자를 공백으로 변환하는 옵션
root@zetawiki:~# echo -e "my\tfriend"
my	friend
root@zetawiki:~# echo -e "my\tfriend" | col -x
my      friend
→ 겉보기에는 차이가 없지만...
root@zetawiki:~# echo -e "my\tfriend" | wc -c
10
root@zetawiki:~# echo -e "my\tfriend" | col -x | wc -c
15
root@zetawiki:~# echo -e "my\tfriend" | hexdump
0000000 796d 6609 6972 6e65 0a64               
000000a
root@zetawiki:~# echo -e "my\tfriend" | col -x | hexdump
0000000 796d 2020 2020 2020 7266 6569 646e 000a
000000f
→ 탭문자(09)가 스페이스문자(20) 여러 개로 변환되어 있다.

3 같이 보기

4 참고 자료