Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZSH Find command replacement
- X-seq: zsh-users 18700
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Aki Hoji <akh22@xxxxxxxx>
- Subject: Re: ZSH Find command replacement
- Date: Sat, 5 Apr 2014 06:53:57 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=mesmtp; bh= CaFl8qYFNvFof7kk6OrObf0qWs0=; b=ZVBDZc2troBOCI1Vf4l5wSkfkdyA7nR4 XgU/cQC8wEUPPt/mYpsBX1tF3ZNEs82C8LKrxtEajEda1gqidTpY9kNEdNzRE/9m HxFdqndiLWoio3PvKb6j6vZXzbtH36udSJfNgjFtdxXgLKvZKHMXl9cnk9fXtg6w Yjbfz2z6mOI=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=CaFl8qYFNvFof7kk6OrObf0qWs0=; b=MSoVABI8LNYVy+PiqGChTTOHM4wd c9BZp9FSuq9KOMOX8WP2PoRc50+EXykcr56/PQJSho9rfv3NMAbmhxLGX52HjKD4 MqsTySk4dkiy0uG7eDxG0wybVvc8OPivkr+eg5iU29NvvjmZdsLZUfsUjNsrmdJo UwWr/NQn7gUWhM0=
- In-reply-to: <FD768579-53CF-43FF-B3C4-10B95E362322@pitt.edu>
- 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: <FD768579-53CF-43FF-B3C4-10B95E362322@pitt.edu>
Aki Hoji wrote on Fri, Apr 04, 2014 at 16:18:58 -0400:
> recently switched to ZSH. I have a quick question. What is the shortest ZSH command equivalent of a following command ?
>
> find . -ctime -1 -type d -exec mv {} /foo/ ;
I'd start with:
echo mv -- *(/ch-1) /foo/
The *(...) syntax is documented in "Glob Qualifiers" in zshexpn(1). The
'c' restricts ctime to the last 1 hour to and the '/' restricts to directories.
I added a '--' for safety (in case a filename begins with a minus),
but that's not specific to zsh; the 'find' version needs it too
(as in, '-exec mv -- {} ... ;').
Messages sorted by:
Reverse Date,
Date,
Thread,
Author