FG
💻 Software

Bash shell: list all files of type .png or .PNG?

Fresh6 days ago
Mar 15, 202616463 views
Confidence Score0%
0%

Problem

In a bash script, how can I say 'for all files of type .png or .PNG'? I'm trying : but getting a syntax error.

Error Output

for i in (`ls *.PNG` && `ls *.png`)

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Bash shell: list all files of type .png or .PNG?

Low Risk

If you want all possible combinations, use: or although that one will make all of your script's shell globs (i.e. wildcard file matches) case insensitive until you run . If you really want just .PNG and .png (and not, for example, .PnG or .pnG), the…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment