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
How to set an array in linux?
What is echo in shell?
What language is bash?
How does shell scripting work?
What language is used in terminal?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
Write a script to print the first 10 elements of fibonacci series.
What are filters explain sort with all the options available?
Why is shell scripting important?
What exactly is a shell?
How do I run a script on mac?
What is meant by $1 in shell script?
What is awk in shell scripting?
What are script files?
Explain about debugging?