Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Oct 2005 14:43:05 +0200
From:      =?utf-8?q?Micha=C5=82_Mas=C5=82owski?= <mtmi@o2.pl>
To:        freebsd-questions@freebsd.org
Subject:   Re: Bash Pattern Matching Syntax
Message-ID:  <200510231443.06819.mtmi@o2.pl>
In-Reply-To: <43518497.6050505@mykitchentable.net>
References:  <43518497.6050505@mykitchentable.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> I want to list the files in a directory that end in ".jpg" irregardless
> of case.  Thus after reading the bash man page, it seems I should be
> able to issue a command something along the lines of "ls [*.[JjPpGg]]"
> or "ls *.[JjPpGg]" but neither of these work and return a "No such file
> or directory" message.  I've also tried various ways of  escaping the
> '*' and '." but that didn't help either.  However "ls *[JjPpGg]" does
> work by listing the files.  However I want to match the "." before "jpg"
> as well.  What is the correct syntax for what I'm trying to do?
>
> Thanks,
>
> Drew

ls *.{JPG,jpg}
or
ls *.{J,j}{P,p}{G,g}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510231443.06819.mtmi>