grep -r greps all files recursively. grep -l outputs only the names of files which contain matching text.
To move the folders, you would have to process that output to select the directory, then move the directory. Probably a perl or shell scripting task. AFAIK grep has nothing so specific as moving the folders the files are in, but it gets you 80% of the way there. --DTVZ On Thu, Oct 29, 2009 at 11:38 AM, Maurice <mauri...@cds-cumberland.org>wrote: > Looking for some guidance; > > I have several files within several folders (5 files per folder, and > thousands of folders) that I need to search a text file within each > folder for a word match (like three_little_pigs.txt, and I need to find > "moe", if he's listed) and then when a match is found I need to move > (not copy) that entire folder (and it's 3~5 files contained within) to > another location... > > I'm thinking grep, but don't know the correct syntax to make all this > happen. > I can easily find all the folders (1949 of them) and the word match 3923 > times within the text file(s)... > > > Any ideas??? > > > > -- > -Maurice Pelletier > Child Development Services - Cumberland County > 50 Depot Road > Falmouth, ME 04105 > 207-781-8881 (voice) > 207-781-8855 (fax) > > www.cds-cumberland.org > > > "Linux -- it's not just for breakfast anymore..." > -Moe > > > > _______________________________________________ > gnhlug-discuss mailing list > gnhlug-discuss@mail.gnhlug.org > http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/ >
_______________________________________________ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/