zsh-users
 help / color / mirror / code / Atom feed
* Re: is there a way to use *.{txt,zip,tbz,dmg} if one or more might be
@ 2019-07-07 23:39 jdh
  0 siblings, 0 replies; 2+ messages in thread
From: jdh @ 2019-07-07 23:39 UTC (permalink / raw)
  To: zsh-users


There shold be two ways to do that;

      1.)  Using extended flags

      	   	 setopt nullglob        # this will last throughout your session


or     2.) Add the 'N' flag like this:

      	         ls *.{txt,pdf,ods,odg,jpg}(N)   # this is on a singular basis


	You may need to prefix the 'N' like this (#QN) but I didn't have to.

       	         ls *.{txt,pdf,ods,odg,jpg}(#qN)


TJ Luoma <luomat@gmail.com> wrote:

> This seems like one of those things that I might have not learned that
> everyone else knows, so I thought I'd ask.
> 
> I can use this:
> 
>         mv -vn *.{txt,zip,tbz,dmg} ~/dir/
> 
> to move all files that end with zip/txt/tbz/dmg to ~/dir/
> 
> BUT it will fail if it does not find at least one file with each of
> those extensions.
> 
> Is there a way to do basically the same thing, but tell `mv` "if is at
> least one file with any of these extensions, then move to ~/dir/" ?
> 
> I suppose I could use `find` with various `-o` flags, but I was
> wondering if there was an easier way.
> 
> Thanks!
> 
> Tj
> 
> --
> TJ Luoma
> TJ @ MacStories
> Personal Website: luo.ma (aka RhymesWithDiploma.com)
> Twitter: @tjluoma

^ permalink raw reply	[flat|nested] 2+ messages in thread
[parent not found: <20190707163948.6202__37372.3986953095$1562542863$gmane$org@Huxley>]

end of thread, other threads:[~2019-07-21 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-07 23:39 is there a way to use *.{txt,zip,tbz,dmg} if one or more might be jdh
     [not found] <20190707163948.6202__37372.3986953095$1562542863$gmane$org@Huxley>
2019-07-21 19:11 ` Stephane Chazelas

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).