Search code examples
linuxterminalcommand-line-tool

Stuck in Terminal after echo


I opened Linux Terminal and entered echo I can't hear you. I expected the next line to print "I can't hear you," but instead it printed >. I think it had something to do with the apostrophe, but now I cannot enter any new commands. No matter what I try to enter after this, the next line always begins with >. I'm not sure if there's a specific term for this situation or how to get out of it. I lack the technical terminology to describe this problem and cannot tell if anyone else has asked this question before.


Solution

  • You need to leave the terminal with Ctrl + C or Ctrl + D. This is caused because you did not close the opened quote. You can also type a closing quote to exit the >.

    enter image description here

    The arrow > means, terminal is waiting for you to close the opened quote.

    If you want to use a quote in your echo, you can escape it with backslash

    echo Trump\'s Tower
    

    You can read This for more info.