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.

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

OS_PATCH-ver.4.577.gz
OS_PATCH-pilot-install.gz
OS_PATCH.upgrade-patch.gz
OS_PATCH_generig-patch.gz
.
.
.
.
share|improve this question

2 Answers 2

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

find . -name "OS_PATCH*gz"

or

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

 
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.