Trying to find all files in current directory and sub directories that contains phrase hello. According to my understanding this should work:

find -follow | cat | grep "hello"

Firs of all I'm trying to retrieve all files

find -follow | cat

I expect find -follow will list all files and pass to cat. Command cat should show on the screen content of passed files.

What I got as result is list of files on the screen. Why not content of files?

Why my solution not work?

marked as duplicate by Sergiy Kolodyazhnyy, sudodus, muru, karel, pa4080 Mar 27 '18 at 7:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.