2012年8月13日 星期一

grep 輸出到檔名

常用的方法是:
grep -inR "Exception" device_e000* > out.txt
                pattern          source                target

參數說明:
-i, --ignore-case         ignore case distinctions

-n, --line-number         print line number with output lines
      --line-buffered       flush output on every line

-R, -r, --recursive       equivalent to --directories=recurse
      --include=PATTERN     files that match PATTERN will be examined
      --exclude=PATTERN     files that match PATTERN will be skipped.
      --exclude-from=FILE   files that match PATTERN in FILE will be skipped.