Skip to main content
added 1 characters in body
Source Link
eLRuLL
  • 18.8k
  • 9
  • 76
  • 104

The answer you selected is fine, and it works, but it isn't the correct way to do it, because:

grep -nr yourString* .

This actually searches the string "yourStrin" and "g" 0 or many times.

So the proper way to do it is:

grep -rnr \w*yourString\w* .

This command searches the string with any character before and after on the current folder.

The answer you selected is fine, and it works, but it isn't the correct way to do it, because:

grep -nr yourString* .

This actually searches the string "yourStrin" and "g" 0 or many times.

So the proper way to do it is:

grep -r \w*yourString\w* .

This command searches the string with any character before and after on the current folder.

The answer you selected is fine, and it works, but it isn't the correct way to do it, because:

grep -nr yourString* .

This actually searches the string "yourStrin" and "g" 0 or many times.

So the proper way to do it is:

grep -nr \w*yourString\w* .

This command searches the string with any character before and after on the current folder.

Source Link
eLRuLL
  • 18.8k
  • 9
  • 76
  • 104

The answer you selected is fine, and it works, but it isn't the correct way to do it, because:

grep -nr yourString* .

This actually searches the string "yourStrin" and "g" 0 or many times.

So the proper way to do it is:

grep -r \w*yourString\w* .

This command searches the string with any character before and after on the current folder.