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
What is shell and shell script?
write a shell script to check the failed jobs?
How does shell scripting work?
What is bash eval?
Is shell scripting easy to learn?
What does echo mean in scripting?
Why is it called a shell?
Which scripting language is best for automation?
I want to connect to a remote server and execute some commands, how can I achieve this?
Why is a script important?
How do I stop script errors?
What are the different communication commands available in the shell?
What is echo $shell?
What does echo $0 do?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script