【Shell】grep


grep如果要作recursive尋找還要下一堆參數太麻煩了,可以寫一個script,假設命名為 /usr/bin/grab

#!/bin/bash
{
 grep "$@" -rsi *
}

$@代表用所有的輸入的參數當條件,例如

$ grab “Any string you wanna grab”

就會跑出要查詢字串的結果。

【參考】

 

Ed32. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com