bulk rename files
hi,
i have a bunch of files which i want to rename by truncating first 6 and last 4 characters from the file name keeping the extension the same. original file name Code:
20081_dinnerparty01.jpg.jpg Code:
dinnerparty01.jpg regards atiman |
Have you tried using sed?
Code:
old_name=20081_dinnerparty01.jpg.jpg |
Hi,
welcome to LQ! Hmmm ... interesting :} It will depend on what rename comes with BSD ... man rename |
Quote:
Code:
#!/bin/sh |
thx everybody .... i tried all of them and the one which worked for me was rename command. I had run the command a few times to get the desired result.
@Disillusionist i have never used sed :( @overlook i tried ur script but all i got was permission denied error @Tinkster man rename worked thx again for the help regards atiman |
if you don't mind a ready script and you have Python, here's how you can use it:
Code:
# ls -1 *.jpg |
All times are GMT -5. The time now is 01:19 PM. |