Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how to match all files that start with the string OS_PATCH and ended with .gz

remark - the solution must to fit Linux and Solaris OS

this task could be by find command or maybe with ls with Regular Expressions or any other idea for example awk

for example

share|improve this question

You do not tell where you want to look, here are possible ways:

find . -name "OS_PATCH*gz"


ls OS_PATCH*gz
share|improve this answer

Try with:

find . -regex '.*/OS_PATCH.*\.gz$'
find /folder/where/you/look/for/files -regex '.*/OS_PATCH.*\.gz$'
share|improve this answer
This wont work with Solaris standard find as -regex is a Gnu extension. – jlliagre May 30 '12 at 9:47

Your Answer


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.