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

What is shell and terminal?

948


What is a program shell?

1002


What is another name for a bash shell script that you might see?

1433


What is the use of "$#" in shell scripting?

1010


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

1078


What is bourne shell scripting?

936


What is awk script?

936


What does $@ mean bash?

1119


Can shell script run on windows?

1007


I want to connect to a remote server and execute some commands, how can I achieve this?

990


What's the difference between scripting and coding?

1118


Differentiate between ‘ and ” quotes.

1109


Can we run shell script in windows?

1079


How will you print the login names of all users on a system?

929


What is shift command in shell script?

980