Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 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.

add comment

1 Answer 1

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 at 11:34
add comment

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