Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Given a file find the count of lines containing the word "abc".

1609


c program to display the information of given file similar to givan by the unix or linux command ls -l

2260


How to get the last line from a file using just the terminal?

1274


What is bash shell command?

1051


What are the different types of variables used in shell script?

1139


What is bash command used for?

1114


Explain about non-login shell files?

1265


What happens on a system call?

1070


What is the syntax of "nested if statement" in shell scripting?

1141


What is the command to find out users on the system?

1015


How do I open the shell in cmd?

1208


What is mac default shell?

1143


What is option in shell script?

1060


What are the advantages of shell scripting?

1092


What is shift command in shell script?

1090