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 10911
- From: "Matt Wozniski" <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: 'mv' all files containing a certain string to a sub-directory
- Date: Tue, 31 Oct 2006 08:40:41 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tfHrY4aGXZdiYeByNdMug7ds1e/JoOSqA/aHZducGJWsRLMKXDi55prVr24i95MApaEIuqVq2k9v25Oj0IUnCnhM1BeUcsTs+lnaKFx7ojA/Bh1889PghAdEcLyNGvy5YpWa48Wn0o5ubYeiRty0liH0LYduYe2QST8Z+ceEYMs=
- In-reply-to: <45474ECD.7040309@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns986D84207EE85zzappergmailcom@xxxxxxxxxxx> <45474ECD.7040309@xxxxxx>
- Reply-to: mjw@xxxxxxxxxx
Are you looking for smth like:
find . -type f -exec grep -e "a certain string" {} \; -exec mv {} tmp \;
HTH
Heinrich's suggestion would move files both in the current directory
and subdirectories that match your search string. If you only want
the current directory, you should be fine to use a
mv *somestring* tmp
~Matt
PS - Sorry Heinrich, I accidentally sent this to you instead of the
list at first. My bad. :)
On 10/31/06, Heinrich Götzger <goetzger@xxxxxx> wrote:
zzapper wrote:
> Hi
> 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
>
>
>
Are you looking for smth like:
find . -type f -exec grep -e "a certain string" {} \; -exec mv {} tmp \;
HTH
Heinrich
Messages sorted by:
Reverse Date,
Date,
Thread,
Author