Skip to content

Instantly share code, notes, and snippets.

@simics-ja
Last active October 5, 2021 07:51
Show Gist options
  • Save simics-ja/a80417f16fe8d7907e962d782d8d38b5 to your computer and use it in GitHub Desktop.
Save simics-ja/a80417f16fe8d7907e962d782d8d38b5 to your computer and use it in GitHub Desktop.
[grepコマンド] #grep #shell

ファイル中の文字列を部分一致で検索するのが基本的な使い方

grep <string> <path|file>

例えば、filedir以下からorangeを含むテキストを見つけるには以下のようにする

grep orange filedir/*
grep -e <regex> <path|file>
grep -E <regex> <path|file>
grep <string1> <path|file> | grep <string2>
grep -e <regex1> -e <regex2> <path|file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment