Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to rename all the files in a folder having specific
extension?
Example: I have some files with extension (.txt) in a folder
name 'Test'. I have to rename all the .txt files in a test
and its subdirectories to .my extension.

Answer Posted / manuswami

for file in `ls` ; do NEW=`echo $file | sed 's/.txt/.my/g'`
; mv $file $NEW ; done

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is eval in shell script?

1230


How to check if the previous command was run successfully?

1017


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

4112


Explain about debugging?

1006


What is a file basename?

1034


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

1068


is this growing field and what is average package in this?

2288


I have 2 files and I want to print the records which are common to both.

1149


What happens on a system call?

992


What is shell and shell script?

1102


How do I stop script errors?

1102


How do you find out What is your shell?

1044


Why is used in shell scripting?

978


What does $@ mean bash?

1147


What is the use of .sh file?

1100