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

Why is used in shell scripting?

1010


What language is used in terminal?

995


How do I stop script errors?

1149


How would you compare the strings in a shell script?

995


What is bash used for?

1019


How do scripts work?

1050


How do I open the shell prompt?

1207


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

2184


What makes c shell a more preferable option than the bourne shell?

984


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

4077


How do you know which shell I am using?

1057


Calculate a real number calculation directly from the terminal and not any shell script.

1233


How to find duplicate record in file using shell script?

1416


What is awk in shell script?

1244


Is bash an operating system?

995