Changing files extention

Pruthvi123

New Member
Joined
Nov 17, 2018
Messages
1
Reaction score
0
Credits
0
I have these 400 pictures saved as .FIT and I need to change them into .fit
I have tried the following commands:
rename *.FIT fit field=etn
and
rm 'oldfile'.FIT 'oldfile'.fit

Both don't seem to work for iraf
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,139
Reaction score
7,019
Credits
31,439
G'day @Pruthvi123 and welcome to linux.org :)

What Distro are you using?

Chris Turner
wizardfromoz
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,139
Reaction score
7,019
Credits
31,439

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
952
Reaction score
1,848
Credits
1,452
also, if they're in dif directories.. you could do something like.. (borrowing the mv portion from above...)

Code:
for file in $(find /path/ -type f -name *.FIT);do mv -- "$file" "${file%.FIT}.fit" ;done

Edit: if using 'rename', I wrote this a while ago, but seems like centos/fedora have one 'rename' while others (ubuntu, etc..) have other flags..
https://www.linuxos.pro/rename-multiple-files-in-linux/
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation


Top