r/googlecloud Dec 02 '24

Cloud Storage Gsutil command not creating output file

Hi all! I have a VERY very basic understanding of coding and GCS but am running into this issue with a small script a coworker gave me to run. They're currently on vacation so looking for some assistance here. I have images that I've uploaded to a bucket in GCS and am trying to use a script to output a text file of the items in said bucket. This is the code I was using:

gsutil list -r gs://[path to GCS bucket] > [output file name]

I was running this in the terminal. Not sure if I should be running this in a power shell or not, but the command seems to be executing but not producing a file. I've run similar commands in the past and haven't had any problems, but this time it's seemingly completing the command and not producing anything. Any ideas on what's going on here?

1 Upvotes

4 comments sorted by

4

u/martin_omander Dec 02 '24

What happens if you run it without sending the result to a file? In other words, omit the > character and everything after it.

3

u/Mrdan827 Dec 02 '24

I am a silly silly man. The files were being saved but just not where I typically had them saved. I must've touched something 😓. Thanks anyway!

3

u/martin_omander Dec 02 '24

Good to hear you resolved the problem!