Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 'mv' all files containing a certain string to a sub-directory
- X-seq: zsh-users 10916
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: 'mv' all files containing a certain string to a sub-directory
- Date: Tue, 31 Oct 2006 17:51:20 +0100
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=qR8fnG92YaKU85XYz1VCahW9BS6tHKZd6+LeSH1HYT5pCWeQMCC1zMido9qESVb8okKcy73YQBcwqZEdOkz6fuxV0/fQjv1ghoVfVsZsWcTJYWvlfWXlxKUq93occ4nrZJf9t/wWtR8hqJ/YEN5awiCGIShWnHoC/+QGAH0qGKw=
- In-reply-to: <Xns986D9E2B52D2Czzappergmailcom@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns986D84207EE85zzappergmailcom@xxxxxxxxxxx> <200610311419.k9VEJaKf009817@xxxxxxxxxxxxxx> <Xns986D9E2B52D2Czzappergmailcom@xxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On 10/31/06, zzapper <david@xxxxxxxxxx> wrote:
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
That doesn't work with files with spaces in them, though.
nikolai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author