質問

I tried

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

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

役に立ちましたか?

解決

If

shopt extglob

says

extglob         on

then you can try

ls !(*[0-9]*)

Use the following to enable this option

shopt -s extglob

他のヒント

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

Note: removed the * as suggested by BMW.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top