The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-03-2007
piltrafa's Avatar
piltrafa piltrafa is offline
Registered User
  
 

Join Date: Oct 2001
Location: Buenos Aires, Argentina
Posts: 77
rename files help

Hi, I've already search for this issue but I found different scripts for rename files, but I don't know how to customize it for my needs.
Here's what I want to do:

I have a lot of files inside many directories, like this:
/aa/01.txt
/aa/02.txt
/ab/01.txt
/ab/02.txt

I want all those files in only one directory, but I have a 01.txt file on each directory, means with the same name, so if I move all the files the last one will overwrite the one with the same name.

Because I'm a newby (and with a poor english) I've tried using something like:

find . -name '*.txt' -exec mv {}:\

but I don't know how to put a variable inside the {}.

I know a very simple script will do the trick, sadly I don't know how to do it.
Maybe you could help me with some tip. Thanks a lot!!!