Thread: ls question
View Single Post
Old Feb 9th, 2007, 3:44 PM   #4
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
In ksh and bash you can use a limited form of regex called pattern-matching

ls *.c lists all of the file that have a . followed by the letter c
ls *.[!c] lists all of the files that have a do and do not end in c

the [c] thing is a class of characters. The [!c] means not this class of characters. You can also do
ls *.[Oo] This lists files that end in O or o.

This is all part of globbing in shell.
jim mcnamara is offline   Reply With Quote