Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Linux / UNIX and the fly likes Unix Find Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Unix Find" Watch "Unix Find" New topic

Unix Find

Kishen Singh Punjabi
Ranch Hand

Joined: Sep 14, 2012
Posts: 68

I am trying to find a data, how to search it in all the files in the directory.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62746


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

its unclear what you are asking. 'grep' will search through files and look for text.
'find' will look for file names, and perform some action on them.
Jim Venolia
Ranch Hand

Joined: Sep 07, 2013
Posts: 206

I've had this in my .cshrc (now .tcshrc) file for decades:

usage is treegrep some/folder somePattern

I've got other versions that search only c source, java source, etc.

It's a no-brainer. We just need to take it to the next level to turn this into a win-win situation. The best practice is to get rid of the low-hanging fruit first. Ping me with an agenda so we can go flag up on this thing
I agree. Here's the link:
subject: Unix Find