5

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?

1
  • 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, 2013 at 2:47

1 Answer 1

8

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .