Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 'mv' all files containing a certain string to a sub-directory



Peter Stephenson <pws@xxxxxxx> wrote in news:200610311419.k9VEJaKf009817
@news01.csr.com:

> zzapper wrote:
>> I want to 'mv' all files containing a certain string to a sub-directory.
>> Should be trivial but cant think how w/o creating a temporary file
> 
> mv *(.e:'grep -q string $REPLY':) subdir
> 
Seeing PWS's reply reminded me of the conventional way to do this

mv $(grep -il "userid" *.php) done


-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Messages sorted by: Reverse Date, Date, Thread, Author