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
Differentiate between ‘ and ” quotes.
How do I debug a shell script?
What is a shell script? Can you name some of its advantages?
What is bash eval?
What is shell and terminal?
What is the default ubuntu terminal?
Explain about echo command?
What is the use of .sh file?
What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?
How can we find the process name from its process id?
What is a shell environment?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
What is the use of "$#" in shell scripting?
What is ms powershell?
What is the lifespan of a variable inside a shell script?