Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between whitespaces " " and '\ ' in bash

Is there any difference between " " and \ in bash?

For example, ls *" "* and ls *\ * will return the same result for me.

like image 857
Fábio Perez Avatar asked Feb 23 '23 08:02

Fábio Perez


1 Answers

the "" version will incur a teensy bit more overhead to parse the innards of the quotes for any potential variables/operators. The backslash-space version will be seen as only a literal space without the extra overhead. The actual cost in cpu time/memory usage between the two will be utterly microscopic, however, unless it's inside a loop that's being run kajillions of times.

like image 101
Marc B Avatar answered Mar 03 '23 15:03

Marc B