aspose file tools*
The moose likes Linux / UNIX and the fly likes How to search text based content from home directory using find or grep? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "How to search text based content from home directory using find or grep?" Watch "How to search text based content from home directory using find or grep?" New topic
Author

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

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215
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

Joined: Oct 09, 2008
Posts: 92

I don't know if it's the best way, but works:




You need the -print option to print the path to files.


http://serfj.sourceforge.net - Simplest Ever REST Framework for Java
 
 
subject: How to search text based content from home directory using find or grep?