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 / akshay telang

for i in `find . -name "*.txt"`
> do
> mv $i ${i%.txt}.my
> done

Is This Answer Correct ?    11 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is .sh file in mac?

1003


What does $@ mean bash?

1147


What is shell scripting?

1028


What does $1 mean in bash?

1071


Is powershell a bash?

1056


How can I set the default rwx permission to all users on every file which is created in the current shell?

1412


What is shell geeksforgeeks?

1088


How to redirect both standard output and standard error to the same location?

1150


How would you compare the strings in a shell script?

964


What is awk script?

956


c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again

6406


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

984


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2460


What shell is bin sh?

945


What is the significance of the shebang line in shell scripting?

1100