With gsutil tool, is possible to list files where the filename matches a regex?

StackOverflow https://stackoverflow.com/questions/17859743

  •  04-06-2022
  •  | 
  •  

문제

I want to list files that do not start with a certain prefix. I can list them fine, like this:

gsutil ls gs://my_bucket/my_prefix*

How do I do the inverse of that?

도움이 되었습니까?

해결책

The only way to do what you're talking about is to list the bucket and filter the results on your local machine, e.g.,

gsutil ls gs://mybucket/** | grep -v gs://my_bucket/my_prefix

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top