The shell splits your line at the spaces. Sometimes, you need a space inside one argument.
The problem
A file has the name my notes.txt. There is a space in the name:
learner@tidepool:~$ cat my notes.txt
cat: my: No such file or directory
cat: notes.txt: No such file or directoryThe shell gave cat two arguments, my and notes.txt. There is no file with either name.
Put quotes around the words
Text between quotes is one argument. The spaces inside the quotes stay:
learner@tidepool:~$ cat "my notes.txt"
call the vendor on FridayThe quotes are not part of the argument. cat gets my notes.txt, with no quotes.
Quotes also keep extra spaces:
learner@tidepool:~$ echo status: ok
status: ok
learner@tidepool:~$ echo "status: ok"
status: okSingle quotes
Single quotes do the same job here: cat 'my notes.txt'. The chapter "Variables and the Environment" shows one difference between them.
A quote with no end
If you forget the closing quote, the shell waits for the rest of the argument. It shows > in place of the prompt:
learner@tidepool:~$ echo "hello
>Type the closing " and push Enter. Or push Ctrl+C to cancel the line and get a new prompt.