Author Topic: rename command - need help  (Read 769 times)

0 Members and 1 Guest are viewing this topic.

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
rename command - need help
« on: August 01, 2020, 07:49:55 pm »
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.
« Last Edit: August 01, 2020, 09:12:35 pm by ssfc72 »
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go

Offline Jason

  • Administrator
  • Master
  • *****
  • Posts: 3637
  • Humanist. Skeptic. Husband.
Re: rename command - need help
« Reply #1 on: August 02, 2020, 03:45:28 pm »
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.
"With all its sham, drudgery, and broken dreams, it is still a beautiful world." - Max Ehrmann, Desiderata

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
Re: rename command - need help
« Reply #2 on: August 02, 2020, 05:41:54 pm »
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 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go

Offline Jason

  • Administrator
  • Master
  • *****
  • Posts: 3637
  • Humanist. Skeptic. Husband.
Re: rename command - need help
« Reply #3 on: August 02, 2020, 05:57:34 pm »
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.
"With all its sham, drudgery, and broken dreams, it is still a beautiful world." - Max Ehrmann, Desiderata

Offline William

  • Member
  • Explorer
  • *
  • Posts: 36
  • New Guy
Re: rename command - need help
« Reply #4 on: August 04, 2020, 04:35:50 pm »
rename 's/ *Track 3.mp3/Track3.mp3' *.mp3

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

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
Re: rename command - need help
« Reply #5 on: August 05, 2020, 01:41:25 pm »
Thanks William.  I will have to try that, to see if it works.
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go