리눅스 col

Jmnote (토론 | 기여)님의 2015년 3월 15일 (일) 01:37 판 (→‎같이 보기)
  다른 뜻에 대해서는 리눅스 column 문서를 참조하십시오.

1 개요

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

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) 여러 개로 변환되어 있다.

3 같이 보기

4 주석

5 참고 자료