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

2 Answers 2

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, 2012 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .