How do I grep words in all files in a directory?

Đức Lưu

New member
How do I grep words in all files in a directory?
Answer
You need the -d skip option added on.
  1. Grep is searching inside of files. You can search recursively, as you said, if you want to search files inside of a directory.
  2. By default, grep will read all files, and it detects the directories. …
  3. Searching just within the parent directory would be grep -d skip “string” ./*
 

Tìm kiếm

Back
Top