리눅스 col

Jmnote (토론 | 기여)님의 2015년 3월 8일 (일) 00:20 판 (새 문서: ==개요== ;리눅스 col ;/usr/bin/col *개행문자, 공백문자 등을 변환하는 리눅스 명령어 ==실습: -x 옵션== *탭 문자를 공백으로 변환하는 옵...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

리눅스 col
/usr/bin/col

2 실습: -x 옵션

  • 탭 문자를 공백으로 변환하는 옵션
[root@zetawiki ~]# echo -e "my\tfriend" > 1.txt
[root@zetawiki ~]# echo -e "my\tfriend" | col -x > 2.txt
[root@zetawiki ~]# cat 1.txt
my	friend
[root@zetawiki ~]# cat 2.txt
my      friend
→ 겉보기에는 차이가 없지만...
[root@zetawiki ~]# ll ?.txt
-rw-r--r-- 1 root root 10 Mar  8 00:18 1.txt
-rw-r--r-- 1 root root 15 Mar  8 00:18 2.txt
[root@zetawiki ~]# hexdump 1.txt
0000000 796d 6609 6972 6e65 0a64               
000000a
[root@zetawiki ~]# hexdump 2.txt
0000000 796d 2020 2020 2020 7266 6569 646e 000a
000000f
→ 탭문자(09)가 스페이스문자(20) 여러 개로 변환되어 있다.
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}