The UNIX and Linux Forums  


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
how to change permissions only to files, not directories....? narrok UNIX for Dummies Questions & Answers 3 12-13-2008 03:55 AM
Batch changing file extensions cdines Shell Programming and Scripting 5 05-19-2008 06:11 AM
A Batch job to delete files from various directories guruparan18 Shell Programming and Scripting 3 05-10-2008 05:31 PM
simple batch renaming...45-*.php to 46-*.php bcamp1973 UNIX for Dummies Questions & Answers 2 11-01-2006 10:51 AM
Change permission for directories and files mingfei2006 Shell Programming and Scripting 1 08-23-2006 08:00 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-20-2008
dave920 dave920 is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
Question Batch Renaming: Change files' extensions in many sub-directories

Hi all -

I'm trying to rename a large number of files all at once and need some help figuring out the command line syntax to do it. I've already done quite a bit of research with the rename and mv commands, but so far haven't found a solution that seems to work for me. So:

The files exist here:

/public_html/files

However, there are many subdirectories within /public_html/files, and the files within those subdirectories must also be renamed with the same operation. (I'm hoping to be able to rename the files in those subdirectories at the same time, since going through every single one of the sub-dirs -- there are 1000s -- would be very time consuming.)

The files that need renaming are, shall we say, .zzz files. All of them end in .zzz, but the beginnings of their file names are, of course, different.

NOTE: There are OTHER files in these directors that are NOT .zzz files (let's say .jpg files), and those files CANNOT be affected by this rename command.

Let's say I would like to rename all .zzz files within all subdirectories to .zzz_disabled (basically, to disable these files from being accessed), but keep the first part of their file names in tact.

So:

dog_ran_up_the_hill.zzz

BECOMES

dog_ran_up_the_hill.zzz_disabled

And that's pretty much it!

I think I've included all necessary info here.

Can anyone help me come up with the proper command line syntax to batch rename all the files in all the directories?

Thanks so much!
 

Bookmarks

Tags
batch, command, linux, linux commands, rename, solaris

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 05:16 AM.


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