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

잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
 
(사용자 2명의 중간 판 5개는 보이지 않습니다)
9번째 줄: 9번째 줄:
==실습: -x 옵션==
==실습: -x 옵션==
*탭 문자를 공백으로 변환하는 옵션
*탭 문자를 공백으로 변환하는 옵션
<source lang='cli'>
<source lang='console'>
[root@zetawiki ~]# echo -e "my\tfriend" > 1.txt
root@zetawiki:~# echo -e "my\tfriend"
[root@zetawiki ~]# echo -e "my\tfriend" | col -x > 2.txt
my friend
</source>
</source>
<source lang='cli'>
<source lang='console'>
[root@zetawiki ~]# cat 1.txt
root@zetawiki:~# echo -e "my\tfriend" | col -x
my friend
[root@zetawiki ~]# cat 2.txt
my      friend
my      friend
</source>
</source>
:→ 겉보기에는 차이가 없지만...
:→ 겉보기에는 차이가 없지만...
<source lang='cli'>
<source lang='console'>
[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
</source>
[root@zetawiki ~]# hexdump 1.txt
<source lang='console'>
root@zetawiki:~# echo -e "my\tfriend" | col -x | wc -c
15
</source>
<source lang='console'>
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
</source>
<source lang='console'>
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
</source>
</source>
:→ 탭문자(09)가 스페이스문자(20) 여러 개로 변환되어 있다.
:→ 탭문자(0x09)가 스페이스문자(0x20) 여러 개로 변환되어 있다.


==같이 보기==
==같이 보기==
40번째 줄: 45번째 줄:
*[[리눅스 colcrt]]
*[[리눅스 colcrt]]


==주석==
==참고==
<references/>
 
==참고 자료==
*http://svnweb.freebsd.org/base/head/usr.bin/col/col.c?view=markup
*http://svnweb.freebsd.org/base/head/usr.bin/col/col.c?view=markup


49번째 줄: 51번째 줄:
[[분류: util-linux]]
[[분류: util-linux]]
[[분류: deprecated]]
[[분류: deprecated]]
[[분류: 리눅스 필터]]

2017년 7월 11일 (화) 03:39 기준 최신판

  다른 뜻에 대해서는 리눅스 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
→ 탭문자(0x09)가 스페이스문자(0x20) 여러 개로 변환되어 있다.

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}