Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Feb 06 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Feb 06

The files are already incremented right?

For example in:
>
> DSC_0120.jpg

The 0120 is the incremment. So the simplest way would be to loop a mv
rename such as the following example from a quick terminal session:

:~/test$ touch foo_1.jpg foo_2.jpg foo_3.jpg
:~/test$ ls
foo_1.jpg foo_2.jpg foo_3.jpg
:~/test$ for i in foo*; do mv "$i" wedding"${i/foo}"; done
:~/test$ ls
wedding_1.jpg wedding_2.jpg wedding_3.jpg


Does that work for you? or was your needs more complicated? I think I
originally took that example from Debian-administration.com... (that's what
I have bookmarked anyway) ...

Share: