Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 1 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
add comment

Your Answer

 
discard

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.