Title: Message
When trying just mv *.inc *.php I receive an error that the last param must be a directory when moving multiple files.
 
I found this to work though:
 
ls -d *.inc | sed -e 's/.*/mv & &/' -e 's/inc$/php/' | sh
 
-----Original Message-----
From: Bob Buckley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 2:12 PM
To: [EMAIL PROTECTED]
Subject: RE: NEWBIE: Is there an easy way to rename files  

try this
 
mv *.inc *.php.
 
You should always backup or make a copy of the entire directory in which you are operating.
 
With great power comes awesome responsibility.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Brian Lucas
Sent: Wednesday, September 04, 2002 2:59 PM
To: '[EMAIL PROTECTED]'
Subject: NEWBIE: Is there an easy way to rename files

I am trying to rename a bunch of files with extension .inc to .php in one fell-swoop.  Is there a set of commands I can pipe to each other to do this like:
 
ls *.inc | xargs ....
 
or do I need to do a for loop.
 
I read up a little on xargs and on using the ` operator for passing the output to other programs but I am a little mixed up right now trying to grasp xargs, sed, awk, and more.
 
Thanks in advance.

Reply via email to