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 / venugopal adep

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to set an array in linux?

1121


What is echo in shell?

1050


What language is bash?

853


How does shell scripting work?

1055


What language is used in terminal?

941


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

1070


Write a script to print the first 10 elements of fibonacci series.

2282


What are filters explain sort with all the options available?

1282


Why is shell scripting important?

978


What exactly is a shell?

1018


How do I run a script on mac?

1033


What is meant by $1 in shell script?

909


What is awk in shell scripting?

985


What are script files?

971


Explain about debugging?

966