Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When inputting a Google Maps Directions url into the command line (for opening with chromium browser via Terminal) there is an ampersand (&) in the url, however the terminal breaks it there because of Unix stuff being Unix stuff... is there something I can type into the terminal that when the command actually goes through, it will be treated like an ampersand?

will ;amp; work?

share|improve this question
up vote 10 down vote accepted

You need to put the address in quotes:

chromium-browser ''
share|improve this answer
Okay, I had the quote on the end, but not the one up front... that explains it. Thank you. – Leron Jun 28 '11 at 6:24

Quotes will fix this but you can also escape things with a back-slash:


Not saying this is better, by any means, it's just another option for situations like this.

share|improve this answer

It won't actually matter in this case, but there is a difference between single quotes and double quotes.

Double quotes will substitute special characters such as '$' and quotes, whereas single quotes treat everything literally, except for the closing single quote.

Both will group the text together, which causes chromium to treat it a single argument, and characters like ";#&" have no special meaning in that context.

This shows the use of '\' to escape a double quote within double quotes, and a backslash itself:

mat@sen:~$ echo "a&bc\\#de\"f"

With single quotes nothing changes:

mat@sen:~$ echo 'a&bc\\#de\"f'

Without the quotes the '&' splits it into two commands:

mat@sen:~$ echo a&bc\\#de\"f
[1] 2619
bc\#de"f: command not found
[1]+  Done                    echo a
[1]+  Done                    echo a

Usually when dealing with one kind of quote you can just wrap it in the other type, but you may run into problems with this:

mat@sen:~$ echo "'a'bc$foo"

The single quotes aren't substituted, but the '$' is. The following syntax works though:

mat@sen:~$ echo $'a\'bc$foo'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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