I have a cellphone that has internal storage that I can mount using PCManFM-Qt.
I have a few files that all begin with the name “Screenshot_”.
I want to rename them all to remove the prefix.
I tried:
sudo rename 's/Screenshot_//' *
but I get a bunch of Can't rename Screenshot_20250517_083608_x.jpg 20250517_083608_x.jpg: Permission denied

I tried sudo -s and then rename 's/Screenshot_//' *
but ls: cannot open directory '.': Permission denied before the rename.

I tried find . -exec rename 's/Screenshot_//' {} \;
but I get a bunch of Can't rename ./Screenshot_20250517_083608_x.jpg ./20250517_083608_x.jpg: Input/output error

I tried sudo find . -exec rename 's/Screenshot_//' {} \;
but I get:
find: ‘.’: Permission denied find: Failed to restore initial working directory: /run/user/1000/gvfs/mtp:host=SAMSUNG_SAMSUNG_Android_R5CY50MYGQP/SD card/DCIM/: Permission denied

You might be able to get something to work using jmtpfs (available in the repos, at least for 24.04) to mount the phone’s drive. I can recall successfully using it to access files on an ancient phone some years ago, but I don’t remember the details. On the other hand, it’s fairly old and may no longer work with the newer versions of Ubuntu.

Otherwise, I suspect you’d be better off asking for help on a forum related to your phone’s OS.

I didn’t use PCManFM-Qt yet but reading things about it (PCManFM-Qt wiki) and used gvfs I came up with two (maybe not helpful, maybe crazy) thoughts:

  • Did you try running the commands without sudo?
  • Did you try Bulk Renaming of PCManFM-Qt?

This is one of the downsides to gvfs, i.e not all file operations are supported (stuff like mv… ).

Your easiest solution is to copy all the files you want to rename to a local directory (e.g home) using pcmanfm-qt or a terminal shell.

Rename them.

Then copy them back to the phone.
Delete all the old files you don’t want.