Fell into a little file renaming rabbit hole today

Lily 🌸Jul 25, 2026

Today I was going through my old uploaded Steam screenshots, and I realised that I had a bunch of pictures I didn’t really feel like keeping on there. I didn’t want to fully delete them though, so I opted to back them up locally.

My first issue was I had about 160 or so screenshots and I couldn’t easily find an "export all" option? So I logged in on a browser and tried manually saving one picture to start, which gave me a JPEG file with no extension and a filename that looked like a complete URL. 😅

Obviously that wasn’t going to work, so I thought about how I could rename the pictures after download without too much fuss. I use Navi a lot, so I thought “I’ll just make a quick Navi cheat” to see if that could solve it.

I came up with this:

% rename

# Rename a file and replace it with a cuid2 string
mv "<filename>" $(cuid2).jpg

$ filename: fd -tf -d 1 -x echo {} | fzf

The idea is this will find all files in the current directory, pipe the result to fzf so you can choose a file, then use that choice as the input for the mv command to be run. I wanted to also use cuid2 to give me random filenames for each image, as well as add in the missing .jpg extension.

Now, this did work, but only for one image at a time. Considering the amount of screenshots I’d have to rename though, I tried to think up a way to do this in bulk.

Since fd lets you execute commands on the results it returns, I tried to use this:

fd -tf '^https:' -d 1 -x mv {} $(cuid2).jpg

When I tried it on 2 images to test however, I found that 1 image got effectively deleted and 1 remained, with the cuid2 string and extension in place.

After a bit of troubleshooting, it turns out fd doesn’t seem to let you use the command substitution in the way I wanted for this to rename all the images randomly? It was taking all the found images and giving it all the same generated filename, which resulted in only 1 image surviving out of a batch. 🥹

As a result, I did a bit of searching to see if any other specific terminal programs could do what I wanted. My search didn't really turn up anything that directly accommodated what I wanted to do here though.

Eventually, I figured I could just do a for loop and that’d do what I want, right?

A 5-minute read through of the fish shell docs later…

I gave this loop a try:

for f in $(fd -tf '^https:' -d 1) ; mv "$f" "$(cuid2).jpg" ; end

And it worked!!

With that out of the way, it was just a matter of a lot of clicking and tab closing, before I got everything manually downloaded and renamed. I cleaned up all the screenshots from my Steam uploads and I was done!

Now, I wouldn't be surprised if there actually was a way to just bulk download your uploaded screenshots from Steam to a local drive. It's fine though, cause I got to have fun in the terminal, so it all worked out in the end~ 🤭


Log in to leave a note.