1

I tried

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

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

mklement0
  • 312,089
  • 56
  • 508
  • 622

2 Answers2

3

If

shopt extglob

says

extglob         on

then you can try

ls !(*[0-9]*)

Use the following to enable this option

shopt -s extglob
Nik O'Lai
  • 3,367
  • 1
  • 13
  • 16
  • +1. If you wanted to robustly process all matching files inside the script, you can use `for f in !(*[0-9]*); do ...; done` – mklement0 Feb 01 '14 at 23:48
2

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

Note: removed the * as suggested by BMW.

Red Cricket
  • 8,734
  • 16
  • 67
  • 148