1

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
.
.
.
.
1

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

find . -name "OS_PATCH*gz"

or

ls OS_PATCH*gz
0

Try with:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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