"리눅스 tee, 화면과 파일에 동시 출력하기"의 두 판 사이의 차이

2번째 줄: 2번째 줄:
;tee
;tee


==방법: tee==
==개요==
;명령어
;명령어
<source lang='bash'>
명령어 | tee 파일명
</source>
;명령어 (오류메시지까지 파일로 저장가능)
<source lang='bash'>
<source lang='bash'>
명령어 2>&1 | tee 파일명
명령어 2>&1 | tee 파일명
</source>
</source>
==실습==
<source lang='dos'>
[root@jmnote ~]# df -h | tee df.txt
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      35G  3.7G  30G  11% /
/dev/vda1              99M  27M  68M  28% /boot
tmpfs                1006M    0 1006M  0% /dev/shm
</source>
<source lang='dos'>
[root@jmnote ~]# cat df.txt
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      35G  3.7G  30G  11% /
/dev/vda1              99M  27M  68M  28% /boot
tmpfs                1006M    0 1006M  0% /dev/shm
</source>
:→ 화면에 출력된 것과 동일하게 df.txt에도 저장되어 있다.


==같이 보기==
==같이 보기==

2014년 6월 4일 (수) 16:36 판

리눅스 화면과 파일에 동시에 출력하기
tee

1 개요

명령어
명령어 | tee 파일명
명령어 (오류메시지까지 파일로 저장가능)
명령어 2>&1 | tee 파일명

2 실습

[root@jmnote ~]# df -h | tee df.txt
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       35G  3.7G   30G  11% /
/dev/vda1              99M   27M   68M  28% /boot
tmpfs                1006M     0 1006M   0% /dev/shm
[root@jmnote ~]# cat df.txt
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       35G  3.7G   30G  11% /
/dev/vda1              99M   27M   68M  28% /boot
tmpfs                1006M     0 1006M   0% /dev/shm
→ 화면에 출력된 것과 동일하게 df.txt에도 저장되어 있다.

3 같이 보기

4 참고 자료

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