Skip to content

shell如何在输出到日志文件的同时输出到屏幕

二月 8, 2012

虽然只想写一句话“man tee”……还是不要那么不和谐为好。

tee这个命令大概和unix差不多老,比较常用的用法是用管道将你的程序的stdout转给tee:

yourprogram | tee [option] yourlog

比如:

lucky_channel | tee -a lucky.log

(这里-a是append)

Advertisements
No comments yet

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: