I am looking for a way to convert a string to a clean url.

For example :

 wget http://myurl.com/toto/foo bar.jpg

This is going to download http://myurl.com/toto/foo and http://bar.jpg.

I want to download http://myurl.com/toto%20bar.jpg.

I tried some flag like --restrict-file-names=ascii but without success.

I do not want a way to encode not a kind of replace one-by-one.

Any idea ?


Contain the URL in quotes:

wget "http://myurl.com/toto/foo bar.jpg"

This is a general way of containing strings with spaces as a single argument.

  • Damn ... I should think about this. Thank you. – aloisdg Mar 12 '14 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.