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 / manuswami

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

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1172


What is the use of a shebang line?

1134


Which shell is the best?

954


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

990


What is a program shell?

1002


What does path stand for?

1019


What is the purpose of scripting?

1028


How do we delete all blank lines in a file?

1065


What happens on a system call?

962


What is shell terminal?

921


What is a command line shell?

1014


What is shell and shell script?

1087


Is it possible to substitute "ls" command in the place of "echo" command?

1018


What are the different types of commonly used shells on a typical linux system?

1029


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

2100