Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: is there a way to use *.{txt,zip,tbz,dmg} if one or more might be missing?



On Sun, Jul 7, 2019 at 4:28 PM TJ Luoma <luomat@xxxxxxxxx> wrote:
>
> 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/" ?

Use an alternation pattern instead of brace expansion:

    mv -vn *.(txt|zip|tbz|dmg) ~/dir/



Messages sorted by: Reverse Date, Date, Thread, Author