3

there is a whole bunch of files all of them who have the pattern

joob_1_1
joob_1_2
joob_2_1
joob_2_5

so it is joob then underscore numeric underscore numeric - these are also the only files in the folder if that makes it easier. I want to rename them into

job_1_1
job_1_2
job_2_1 ....

there has to be some way to do that automated ? It is just getting rid of that single letter

user3069326
  • 716
  • 5
  • 10
  • 18
  • Recursively seem to imply these files are in different folders in a directory tree. Is this correct? Please edit the question with new information. – user68186 May 17 '15 at 13:03

2 Answers2

4

Use rename :

rename 's/^joob/job/' joob_*

This will change the file names starting with joob to job.

Test :

$ ls
joob_1_1  joob_1_2  joob_2_1  joob_2_5

$ rename 's/^joob/job/' joob_*

$ ls
job_1_1  job_1_2  job_2_1  job_2_5
heemayl
  • 91,753
1

If you want to do it the gui way, here is an alternative to the very good suggestion of heemayl. You can try krename:

sudo apt-get install krename

this is as powerful as rename (with the exception that it can't be piped to in a script). enter image description here

Bruni
  • 10,542