Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I typed in a single ' by accident and I got this as a result and exited out of it after typing ' in again.

> '

: command not found

What does this do?

share|improve this question

marked as duplicate by Patrick, slm Jul 8 '14 at 12:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You started writing a string literal: everything between ' and the next ' is treated as a single "thing" by the shell, including newlines, spaces, and any other characters. Here you wrote a string containing two newlines.

That meant that the first thing on the line was \n\n (two newlines). Because the first thing on a line is always the command to run, the shell looked for a command by that name. Because there's no command called \n\n, you got the "command not found" error.

The > prompt at the start of the second and third lines means that the shell is waiting for you to finish writing the quoted string, and letting you know it isn't done yet. The shell prints out the value of $PS3 in that situation, which is > by default.

share|improve this answer
is it really $PS3 ? This variable seems to empty on my system: echo $PS3 gives just an empty line. – Martin Vegter Jul 9 '14 at 11:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.