パイプをgrepする方法

パイプをgrepする方法

|パイプ文字または文字を含む行を見つけるためにgrepする方法>

files content:
|this is test
where is >
this is none

grepを使用する必要があるコマンドは次のとおりです。

grep -iE "<some expression>" file_name

出力:

|this is test
where is >

ベストアンサー1

標準grep構文を使用してください。

grep '[>|]'

または

grep -e '>' -e '|'

または

grep '>
|'

または

grep -E '>|\|'

おすすめ記事