Hacker News new | ask | show | jobs
by nick0garvey 2518 days ago
First question didn't go great, would be nice if there was a way to report missing answers.

Question: Write the command which you use to move inside the directory which has the name 'my dir' (the name contains a space)

Your answer: cd 'my dir'

Correct answer: cd my\ dir

3 comments

And in practice: `cd my<tab>`. I strive to make the first three letters of a filename a unique prefix in each directory; and if I were to use a space like this, I’d be making sure “my” was a unique prefix. This system becomes a sufficiently ingrained habit that I can’t cope with Zola having a directory “content” beside a file “config.toml”.
Tab completion isn't default in every shell
I did that too and learned backslashing the space is another way. Next time I'll do it that way and win the sweet green.
There are so many ways to escape the space. It did not accept cd my" "dir either.