WORD SEARCH - CHECK IF CORRECT!

Im currently working on a Script using PICO editor, the scripts purpose is :
When you typed a certain "word" and press enter, All directories, Script, and any other files that contain that "word" will be displayed.. for example i typed "DOG".. all executable script, Directories, and any other files will be shown... The most complex is, that it will show all the Script file that has the word "DOG" inside it..

HERE IS MY ATTEMPT :))

"ENTER WORD:"
read $word
find / -name $word 2>/dev/null

if you have any suggestions it would be so well appreciated :)).

go for "grep" command to search the content of the file

1 Like

Where will i put the command "grep" in my script?

THANKS! :o

 
find / -type f 2>/dev/null | xargs grep "$WORD"