[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How Bash can delete wildcard with exceptions
From: |
alex xmb ratchev |
Subject: |
Re: How Bash can delete wildcard with exceptions |
Date: |
Sat, 1 Jul 2023 13:05:46 +0200 |
On Sat, Jul 1, 2023, 11:34 Budi <budikusasi@gmail.com> wrote:
> How Bash can delete wildcard with exceptions e.g. deletion below
> except delete FOO.BAR
>
> $ ls
>
> BOO.BAR
> MOO.BAR
> COO.BAR
> FOO.BAR
> JOO.BAR
> NOO.BAR
> ZOO.BAR
> BOO.BAZ
> MOO.BAZ
> COO.BAZ
> JOO.BAZ
> FOO.BAZ
> NOO.BAZ
> ZOO.BAZ
>
> tried:
> $ shopt -s extglob globstar
>
> $ rm *.BAR !(FOO.BAR)
>
> not work, it wiped all! Help!
>
shopt -s extglob dotglob
rm !(FOO.BAR)
>