grep -l will get you just the filenames
tree --fromfile will read from stdin just fine
So: grep -ril "foo bar" . | tree --fromfile -a should do the trick.
Edit: removed -n from the grep incantation per below conversation.
grep -l will get you just the filenames
tree --fromfile will read from stdin just fine
So: grep -ril "foo bar" . | tree --fromfile -a should do the trick.
Edit: removed -n from the grep incantation per below conversation.