The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Rename files
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-27-2009
edgarvm edgarvm is offline
Registered User
  
 

Join Date: May 2009
Posts: 26
i haven't tested this but it should work:
Code:
#!/bin/sh
dir=/tmp
for oldname in `find $tmp -type f`; do
   newname=`echo $oldname | tr ':' '-'`
   mv $oldname $newname
done

Last edited by edgarvm; 05-27-2009 at 10:47 AM.. Reason: indentation