2010-07-13 09:42:08 +0000 2010-07-13 09:42:08 +0000

Réponses (5)

Solution trouvée!

Score 299
2010-07-13 09:47:11 +0000
grep -r 'text goes here' path_goes_here
Advertisement
Score 31
2010-08-12 22:38:59 +0000

スポットライトを使用して

mdfind "text goes here"
mdfind -onlyin /home/user/Desktop -live "live update"

を見ることを忘れないで下さい:

man mdfind
Advertisement
Score 12
2016-03-03 14:07:18 +0000
Advertisement
  1. Ack
brew install ack 
ack "text goes here"
  1. find
find . |grep "text goes here"

を通して 1. grep

grep -RnslI "text goes here"
``` を通して
Score 4
2017-06-01 08:00:18 +0000

あなたの好みやニーズに応じて、以下のいずれかを選択することができます。例えば、カレントディレクトリ内のテキストを含むファイルを再帰的に検索する必要がある場合、以下のような方法で検索することができます。

grepを使用する enter image description here

ackを使用する enter image description here

Advertisement
Score 2
2017-06-01 15:27:29 +0000
Advertisement

Ignacioさんの回答は素晴らしく、特定のテキストを含むファイルを見つけるのに役立ちました。私が直面していた唯一の問題は、このコマンドを実行すると、パターンが表示されないファイルも含めて、すべてのファイルがリストアップされることでした。

代わりに:No such file or directory ; -s のように grep -lr "text pattern" ./ -s をコマンドに追加した場合、パターンが含まれているファイルのみが表示されます。grepで'No such file or directory'エラーを出力しないようにするにはどうしたらいいですか?](https://stackoverflow.com/questions/6426363/how-can-i-have-grep-not-print-out-no-such-file-or-directory-errors)