• Welcome to Peterborough Linux User Group (Canada) Forum.
 

rename command - need help

Started by ssfc72, August 01, 2020, 07:49:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ssfc72

Ok, I am trying to rename a batch of 93 files. See attached text file, which is a partial copy of the directory.

I have looked up how to use the rename command but I am getting errors when I try to get it to do the rename operation.
I use wild cards, in the command to try and get it to do all 93 files at once.

Anyone see what I am doing wrong?  I was trying only to rename only 1 file, as a test.
Mint 20.3 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MXLinux)
Cellphone Samsung A50, Koodo pre paid service

Jason

I hadn't heard of rename. Usually you rename files in Linux using the the 'mv' command. I'll look into this and get back to you unless you're already figured it out.

I should mention that you can't just use wildcards to batch rename them which is probably why you're getting an error. You have to use a loop.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

ssfc72

Success!   I downloaded the File Manager, Thunar.  Works excellent, once I found a help page for it,
Thanks for the offer of help, Jason.

http://www.webupd8.org/2016/03/quickly-batch-rename-files-in-linux.html
Mint 20.3 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MXLinux)
Cellphone Samsung A50, Koodo pre paid service

Jason

Well, that's no fun at all!  ;D I'm still working on it in the Command-Line Interface (CLI). And before you say it, shutup Buster. I like figuring out things.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

William

Quote from: ssfc72 on August 01, 2020, 07:49:55 PM
rename 's/ *Track 3.mp3/Track3.mp3' *.mp3

Try adding / at the end of pattern, like 's/ *Track 3.mp3/Track3.mp3/'.

ssfc72

Thanks William.  I will have to try that, to see if it works.
Mint 20.3 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MXLinux)
Cellphone Samsung A50, Koodo pre paid service