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 / sushanta

for i in *
do
p=`basename $i c`
q=$p "txt"
mv $i $q
done

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is wc in shell script?

936


What does sh mean?

1004


What is @echo off?

942


What is shell geeksforgeeks?

1033


What are filters explain sort with all the options available?

1281


What is an sh file?

887


How do I save a powershell script?

1077


madhar chod unix ke 10 commands dhang se likh nahi sakta hai

3412


How do I run a bin bash script?

971


What is the syntax of "nested if statement" in shell scripting?

1041


What is the best scripting language?

970


Explain how you Automate your application using Shell scripting.

2247


What's the difference between scripting and coding?

1093


What is subshell?

880


Write down the syntax of "for " loop

1039