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 / asit pal

foreach x (`ls *.txt')
set y = `echo $x | cut -d . -f 1`
mv y y.my
done

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I run a script from command prompt?

1088


What are the different types of shell scripting?

1123


What is echo in shell?

1119


What is @echo off?

1028


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

1231


Give some situations where typing error can destroy a program?

1255


Can you write a script to portray how set –x works?

1007


How do scripts work?

1049


What can you do with powershell?

1146


Explain how you Automate your application using Shell scripting.

2324


I have 2 files and I want to print the records which are common to both.

1167


What is shell scripting used for?

1006


Why are shell scripts used?

1087


What is the meaning of $1 in shell script?

1122


What is shell geeksforgeeks?

1119