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

I know, that there are several characters that should be escaped. For example:

$ cd /home/Username\ with\ spaces/Desktop

I know another option is to enclose it in single-quotes.

$ cd '/home/Username with spaces/Desktop'

Is there a complete list of these characters? Or any rule of thumb?

share|improve this question
Did you search the net for "metacharacters"? I searched for "how to escape metacharacters in Linux" and found this link. I'm sure there are many more. If you find this or any other link useful, you could summarize its information as an answer or just make the answer below more complete to avoid having answers that are marginally different from each other. – user25656 Apr 7 '13 at 2:47
up vote 5 down vote accepted

I have wished for a "complete list". I used to have a filter program compiled that would escape every "special character" that I could think of.

A good start: ! ? $ % $ # & * ( ) blank tab | ' ; " < > \ ~ ` [ ] { }

I'm sure there are others that I have missed.

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.