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 / indu sharma

find . -name "*.txt" -exec ls {} \; | xargs -n1 -I{} sh -c 'mv "{}" `echo "{}"|basename "{}" .txt`.my'

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 3 standard streams in linux?

1077


What is the best scripting language?

984


Explain about debugging?

983


How do I stop script errors?

1067


What is basename in shell script?

1023


How many fields are present in a crontab file and what does each field specify?

1080


What are script files?

984


Is shell script a programming language?

991


How does path variable work?

925


What is shell environment?

945


How to check if the previous command was run successfully?

1004


What does $$ mean in shell script?

1011


Explore about environment variables?

1004


What are the different types of shell scripting?

1060


What is a command line shell?

1018