I would like some help in finding a way to check if files matching a certain regex exist in a directory. Currently, I am using the following method, but it will return an error in certain cases:
ls srv_*.log
The above command will result in ls: cannot access srv_*.log: No such file or directory if there are no files in the directory matching the regex.
The regex I am trying to match is "srv_*.log"
Does anyone have any ideas?
Thanks.