StarOSでは、show commandの出力をgrepで操作できますが、オプションは限られています。
以下にいくつかの例を挙げます。
grep for Regular Expressions (CLIマニュアルより抜粋)
The | grep has the following syntax:
| grep [ -E | -i | -n |-v | --extended-regexp | --ignore-case | --invert-match | --linenumber] expression
使用例:
① -i (ignore-case) 検索対象文字列のUpper/Lower caseを区別しない
# dir /flash/ | grep -i <Filename of image or config>
# show npu stats debug all | grep -i lag
# show logs | grep -i "slot 9"
② -v (invert-match) 検索対象文字列を含まない行を出力する
# show task resources | grep -v good
③ -E (extended-regexp) 複数指定した文字列のどれかを含む(OR)
# show diameter peers full | grep -E "Task|Host"
④ -n (linenumber) 検索対象文字列を含む行数を表示