0

I couldn't able to get succeed after multiple tries to list out the contents available in path, because my folder name contains ampersand like below.

gsutil ls -r gs://testing_purpose/U&T

It returns error like below CommandException: One or more URLs matched no objects.

'T' is not recognized as an internal or external command, operable program or batch file.

CIPHER
  • 237
  • 1
  • 4
  • 19

2 Answers2

1

Your command shell is interpreting & as a control character, so your statement looks like this to the shell:

yourshell$ gsutil ls -r gs://testing_purpose/U
yourshell$ T

To fix those, you should quote the argument with the control character, like so:

gsutil ls -r "gs://testing_purpose/U&T"

Travis Hobrla
  • 5,411
  • 23
  • 22
  • I am executing this script in Google Cloud SDK shell. I tried these all methods even before, but it throwing back same error.... ! – CIPHER Mar 30 '17 at 04:00
0

What worked for me on Windows and Google Cloud SDK Shell was putting the path inside quotation marks and escaping the & character with ^. E.g.:

gsutil ls "gs://a ^& b"
Kaith
  • 1
  • 1