Awk 컬럼 추가

awk 컬럼 추가

1 명령어[ | ]

명령어 | awk '{print("앞에추가\t"$0)}'
명령어 | awk '{print($0"\t뒤에추가")}'

2 예시[ | ]

[root@zetawiki ~]# ll /var/www/
total 20
drwxr-xr-x 2 root root 4096 Feb 23  2012 cgi-bin
drwxr-xr-x 3 root root 4096 Sep 24  2012 error
drwxr-xr-x 2 root root 4096 Feb 23  2012 html
drwxr-xr-x 3 root root 4096 Sep 24  2012 icons
[root@zetawiki ~]# ll /var/www/ | awk '{print("hello\t"$0"\tworld")}'
hello	total 20	world
hello	drwxr-xr-x 2 root root 4096 Feb 23  2012 cgi-bin	world
hello	drwxr-xr-x 3 root root 4096 Sep 24  2012 error	world
hello	drwxr-xr-x 2 root root 4096 Feb 23  2012 html	world
hello	drwxr-xr-x 3 root root 4096 Sep 24  2012 icons	world

3 같이 보기[ | ]

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