From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27325 invoked by alias); 5 Apr 2014 06:54:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18700 Received: (qmail 6907 invoked from network); 5 Apr 2014 06:54:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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= X-Sasl-enc: cW//iSPeAtWfiXzRiNEw0cSZH1OU492SnhUGdmGaemyZ 1396680842 Date: Sat, 5 Apr 2014 06:53:57 +0000 From: Daniel Shahaf To: Aki Hoji Cc: zsh-users@zsh.org Subject: Re: ZSH Find command replacement Message-ID: <20140405065357.GC25618@tarsus.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 -- {} ... ;').