Frage

I tried

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

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

War es hilfreich?

Lösung

If

shopt extglob

says

extglob         on

then you can try

ls !(*[0-9]*)

Use the following to enable this option

shopt -s extglob

Andere Tipps

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

Note: removed the * as suggested by BMW.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top