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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
delete files recursively in the specified directory deepthi.s Shell Programming and Scripting 3 08-13-2008 10:03 PM
Recursively go thorough subdirectories and checkout files shajiasalim Shell Programming and Scripting 3 08-13-2008 06:28 AM
Recursively changing permissions on files altamaha UNIX for Dummies Questions & Answers 1 03-01-2008 05:15 AM
moving multiple files --recursively using BSD moxxx68 UNIX for Advanced & Expert Users 3 09-12-2005 07:41 AM
List Files Recursively roberthawke UNIX for Dummies Questions & Answers 9 06-24-2002 06:19 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-18-2008
catgovind catgovind is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 8
recursively renaming files

Hi,

I'm new linux user.I need to recursively rename all files .I used this command "rename .MP3\;1 .MP3 *.MP3\;1" to rename files in one directory.But Inside this directory lots of sub directories there. Please help me out how to rename all files recursively?

Thanks
Govindan
  #2 (permalink)  
Old 08-18-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Quote:
Originally Posted by catgovind View Post
I'm new linux user.I need to recursively rename all files .I used this command "rename .MP3\;1 .MP3 *.MP3\;1" to rename files in one directory.But Inside this directory lots of sub directories there. Please help me out how to rename all files recursively?
I'm not familier with the 'rename' command, it could be that there's an optional commandline switch to recurse through subdirs. If not, this should do the trick:
Code:
find . -type f -name '*.MP3;1' | while read filename ; do mv "$filename" "`echo $filename" | sed 's/MP3\;1$/MP3/'` ; done

Last edited by Smiling Dragon; 08-18-2008 at 07:57 PM..
  #3 (permalink)  
Old 08-20-2008
catgovind catgovind is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 8
Hi Thanku

Its worked for my problem. []
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0