Output to console and file

user-pic
Vote 0 Votes

有時想要在 console 看到輸出資料而且又想留下 log, 可以這樣做

command 2>&1 | tee file.log

2>&1 是指 stderr 導到 stdout
tee 可以把 stdout 複製一份到檔案

Leave a comment

About this Entry

This page contains a single entry by Pank published on February 6, 2012 6:03 PM.

Galaxy Nexus 4.0.2 was the previous entry in this blog.

Chrome for Android Beta is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives