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
Why is the use of shell script?
What is a shell in operating system?
Explain about login shell?
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
How to write a function?
How to print pid of the current shell?
What is the difference between grep and egrep?
Is shell scripting difficult?
What is the fastest scripting language?
What is a batch file used for?
What does echo $0 do?
Which shell is the best?
How do we delete all blank lines in a file?
What does $$ mean in shell script?
Is shell scripting a language?