Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there any way I can target a range of a-c* in one go?

For example, instead of doing this individually;

/home/a*
/home/b*
/home/c*

I've tried testing with ls, but not sure if it's working right.

ls /home/[a-c]*
share|improve this question
    
ls /home/[a-c]* seems to work ok. I've added an alternate way of expanding a sequence. –  Aaron Copley Jul 17 '13 at 18:08
    
Totally did the trick. Thanks! –  Will Ashworth Jul 17 '13 at 19:11

2 Answers 2

up vote 7 down vote accepted
ls /home/{a..c}*

(This is some extra text to meet the minimum body length.)

share|improve this answer

Alternatively, if you want a non-contiguous list:
ls /home/[aceg]*
will list /home/a*, /home/c*, /home/e*, /home/g*

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.