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 terminal?
What is a program shell?
What is another name for a bash shell script that you might see?
What is the use of "$#" in shell scripting?
How many fields are present in a crontab file and what does each field specify?
What is bourne shell scripting?
What is awk script?
What does $@ mean bash?
Can shell script run on windows?
I want to connect to a remote server and execute some commands, how can I achieve this?
What's the difference between scripting and coding?
Differentiate between ‘ and ” quotes.
Can we run shell script in windows?
How will you print the login names of all users on a system?
What is shift command in shell script?