Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep, maybe



On 10/29/2009 11:47 AM, John Abreau wrote:
> Assuming no spaces or other troublesome metacharacters
> in the filenames and folder names:
> 
>     mv $( find /path/to/src/root -type f | xargs grep -l moe |
>         sed 's-/[^/]*$--' | sort -u ) /path/to/destination/

If there are spaces, then change it to:

... find /path/to/src/root -type f -print0 | xargs -0 grep -l moe ...

DR






BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org