From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Aki Hoji <akh22@pitt.edu>
Cc: zsh-users@zsh.org
Subject: Re: ZSH Find command replacement
Date: Sat, 5 Apr 2014 06:53:57 +0000 [thread overview]
Message-ID: <20140405065357.GC25618@tarsus.local2> (raw)
In-Reply-To: <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 -- {} ... ;').
next prev parent reply other threads:[~2014-04-05 6:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 20:18 Aki Hoji
2014-04-05 6:53 ` Daniel Shahaf [this message]
2014-04-07 7:59 ` Michal Politowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140405065357.GC25618@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=akh22@pitt.edu \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).