Question

I tried

#!/bin/bash
ls * [!0-9] * .*

but that doesn't work - I still get some files that contain a number.

Was it helpful?

Solution

If

shopt extglob

says

extglob         on

then you can try

ls !(*[0-9]*)

Use the following to enable this option

shopt -s extglob

OTHER TIPS

how about good ol grep like so ... ls | grep -v "[0-9]"

Note: removed the * as suggested by BMW.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top