I am trying something super basic but I don’t get why my find command cannot find a substring. Here is the output
15:04b0 gmmo@mylinuxbox ~/test_search> cat somefile.txt
find substring here!
15:04b0 gmmo@mylinuxbox ~/test_search> find . -name "*sub*" -print
15:04b0 gmmo@mylinuxbox ~/test_search>
Does the string inside the quotes need to be regex?
I am following this thread
Find all files with name containing string
What is the proper syntax to find all file containing a sub-string case insensitive in it recursively ideally?
>Solution :
Dont be confused by filenames and text content:
find . -type f -exec grep -il 'sub' {} +
or simply:
grep -ril 'sub' .
or with ack aka beyond than grep (faster):
ack -il 'sub'