• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to search text based content from home directory using find or grep?

 
James Dekker
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How could someone using a Unix system (mine being OS X Snow Leopard) use find or grep (either separate or together) to search for files containing a specific string recursively in their home directory?

Is it better to use the locate command instead?

I've tried:









Thank you for taking the time to read this...
 
Eduardo YaƱez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if it's the best way, but works:




You need the -print option to print the path to files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic