Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
is there a way to use *.{txt,zip,tbz,dmg} if one or more might be missing?
- X-seq: zsh-users 24027
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: is there a way to use *.{txt,zip,tbz,dmg} if one or more might be missing?
- Date: Sun, 7 Jul 2019 19:27:00 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wMZYjY2yhnQYtQjFJ+6XKx5l2zEd6Um6SJmezVJioMQ=; b=o0IWaubJkckOuEFvn9voKZfDjA8cupEfCOlsJ9nelWeyWL8MD/irHjk9l+c6p5P1me k/OWdrjL9/MXOFvksgpea5kvkLqrngyUeTkxiRE+ud67l1n3q6Mz2zEuX5n2Rg5TMDLK oGcEasRJIKyT/tQjAhxrvuuZiofLKG0yAotkCpoL/ylNyEECC3ZW8sjgHQ4WN7PqG43b AqbqDKAO4LvP5fjOrTmrWOWfME/r9W4hZYFcbH5dYYKgl5ypXXgdw4qELnGCTMYf7Vt9 8r/QWXE2b6X/rdzBXK4kKXI3uDUWrPcFXwSLRgzVA0QUKSqrsn0myu6ByZCRcmCO8QXR Mz1Q==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author