Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 31st March 2011, 17:37
turki_00 turki_00 is offline
Junior Member
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default bash - rename files in a loop

Hi,
I need to rename the resulted searched files from a loop

I have the following code:

find . -name DOC* | while read i
do
find $i -type f -name '*.txt'
done

basically, I am searching for all txt files inside any folder starting with DOC name.
this code is working fine with me.
I need to rename those .txt files to .txtOLD

OS: Ubuntu 10.4
Bash shell

how can i do that , appreciate your help
Thank you,
Reply With Quote
Sponsored Links
  #2  
Old 5th April 2011, 12:14
alleks alleks is offline
Senior Member
 
Join Date: Nov 2010
Posts: 157
Thanks: 9
Thanked 9 Times in 9 Posts
 
Default

that's easier than it looks

just do a
Code:
mv *.txt *.txtOLD
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian 5.0 'hangs' GHz Installation/Configuration 5 1st October 2009 12:57
The system is currently updating the configuration files. warlock General 8 21st February 2009 18:15
i am having some problem ? cobro Installation/Configuration 20 30th April 2008 16:26
Cannot log onto pop3 server Debian Etch Perfect Server docean Installation/Configuration 2 19th March 2008 00:23
https protocol stops page load tjd General 7 18th November 2007 18:06


All times are GMT +2. The time now is 06:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.