1

I tried

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

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

mklement0
  • 382,024
  • 64
  • 607
  • 775

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,586
  • 1
  • 15
  • 17
  • +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
  • 9,762
  • 21
  • 81
  • 166