Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コマンド ラインで、またはbashという名前のすべてのファイルを検索したいと考えています。私はこれを試しました:foobar
bash
foo
bar
find . -name "foo\|bar"
しかし、それはうまくいきません。正しい構文は何ですか?
あなたがしたい:
find . \( -name "foo" -o -name "bar" \)
(すべての場所の)ウィキペディアのページを参照してください
私は検索で安いです、私はこれを使用します:
find ./ | grep -E 'foo|bar'
これは私の個人的な好みにすぎません。構文を「取得」するのが簡単で、一度マスターすると、ファイル ツリーをたどるよりも多くの用途があるため、find よりも grep が好きです。