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 / asit pal
foreach x (`ls *.txt')
set y = `echo $x | cut -d . -f 1`
mv y y.my
done
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do I run a script from command prompt?
What are the different types of shell scripting?
What is echo in shell?
What is @echo off?
Calculate a real number calculation directly from the terminal and not any shell script.
Give some situations where typing error can destroy a program?
Can you write a script to portray how set –x works?
How do scripts work?
What can you do with powershell?
Explain how you Automate your application using Shell scripting.
I have 2 files and I want to print the records which are common to both.
What is shell scripting used for?
Why are shell scripts used?
What is the meaning of $1 in shell script?
What is shell geeksforgeeks?