How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh".
Appreciate your inputs.Thanks.
Answer Posted / senthil m
For single file, you can do following command;
mv interview\ question.sh interview-question.sh
For multiple files on the current working folder;
for i in *\ *.sh
do
j=`echo $i|sed "s/ /-/g"`
mv "$i" $j
done
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Given a file find the count of lines containing the word "abc".
c program to display the information of given file similar to givan by the unix or linux command ls -l
How to get the last line from a file using just the terminal?
What is bash shell command?
What are the different types of variables used in shell script?
What is bash command used for?
Explain about non-login shell files?
What happens on a system call?
What is the syntax of "nested if statement" in shell scripting?
What is the command to find out users on the system?
How do I open the shell in cmd?
What is mac default shell?
What is option in shell script?
What are the advantages of shell scripting?
What is shift command in shell script?