Forum Home
Press F1
 
Thread ID: 41228 2004-01-04 00:28:00 I need to rename files ilikelinux (1418) Press F1
Post ID Timestamp Content User
205125 2004-01-04 00:28:00 Is there a command in linux to rename files from some thing like
index.php3 to index.php ?

plz help
ilikelinux (1418)
205126 2004-01-04 01:19:00 mv index.php3 index.php
Or, you can use a GUI and just hit "F2" :-)
Chilling_Silently (228)
205127 2004-01-04 01:21:00 thx,

can you shed any light on renameing lots of files?

//plz dont mention typing fast.
ilikelinux (1418)
205128 2004-01-04 01:29:00 If you are just wanting to remove the "3" on the end of the filenames, it would pay to mention that.

There isnt any Magic file-renamer which knows exactly what you want, nor do PressF1'ers...

You will have to write some sort of a script to do it...
Chilling_Silently (228)
205129 2004-01-04 01:31:00 sorry, guys, i'll just rename my self... ilikelinux (1418)
205130 2004-01-04 01:34:00 Easy. :D

ls -d *.php3 | sed 's/\(.*\).php3$/mv "&" "\1.php/' | sh
Graham L (2)
205131 2004-01-04 01:46:00 thx...

it wont actually wont work for me, (the command wil)because it is all website files link to each other....

Graham, Thx any way i'll keep that some where.
ilikelinux (1418)
205132 2004-01-04 01:53:00 OOPS: there are two characters which are easily confused in this clever [ p r e ] formatting. 1 & l. The "ls -d" uses the lower case L. The "1.php" has the numeral 1. Graham L (2)
1