Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: executing commands in directories containing specific files
- X-seq: zsh-users 18423
- From: Jan Larres <jan@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: executing commands in directories containing specific files
- Date: Wed, 12 Feb 2014 15:17:21 +1300
- In-reply-to: <CALyv6VBuNBYg-D2rzXu36S=_cnT_6LqdEKHHDajUGy7s3ioXOg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAMXWGTzazAWLG6y1Q_zKvxmUewgAq9Z9CdksQ-Tb7kxfP-RHUg@mail.gmail.com> <ldefjc$9l1$1@ger.gmane.org> <CALyv6VBuNBYg-D2rzXu36S=_cnT_6LqdEKHHDajUGy7s3ioXOg@mail.gmail.com>
On 12/02/14 14:17, Philip Dexter wrote:
> On Tue, Feb 11, 2014 at 7:35 PM, Jan Larres <jan@xxxxxxxxxxxxxx> wrote:
>> On 12/02/14 13:11, Leonardo Barbosa wrote:
>>> I'd like to find TeX files (find $HOME -type f -name '*.tex'). Let's say i
>>> have found files a.tex, b.tex, and c.tex. Now, i wanna remove a.aux, b.aux,
>>> c.aux. What's the best way of doing that?
>>
>> find $HOME -type f -name '*.tex' -exec rm {} \;
>>
> That won't get the aux files
Oh, whoops. I missed the differing extensions. In that case your
solution is probably best, except without removing the tex files
themselves:
for f in $HOME/**/*.tex; do rm ${f:r}.aux; done
Jan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author