Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I accidentaly typed ls' and I got a interactive interface: > What is this?

I tried search on internet, found nothing.

share|improve this question

migrated from Mar 13 '12 at 5:56

This question came from our site for professional and enthusiast programmers.

up vote 34 down vote accepted

This behavior is distro agnostic. You had open a quote, the shell is displaying $PS2 global variable ($PS2 is the > in your output) while the second quote is missing.

You can change PS2 with what you want instead :

Ex: export PS2=">>>"

The value of $PS2 is printed (after expansion) as the secondary prompt for more data when bash is running interactive. See man bash, under PROMPTING.

share|improve this answer
You have good eyes to spot the stray single quote. – mu is too short Mar 13 '12 at 5:39
Added info: To get out, just enter another single quote, or press ctrl-c. – octern Mar 13 '12 at 5:41
Not exactly reading stdin; you can enter a multi-line quote in a script or something just as well; but the secondary prompt is displayed in an interactive session when you enter a newline inside a quoted string, an unfinished loop, etc. – tripleee Mar 13 '12 at 5:43
Better use ctrl-d instead of ctrl-c as EOF (End Of File) – Gilles Quenot Mar 13 '12 at 5:44
thanks, BTW what does PS2 stand for? – Anders Lind Mar 13 '12 at 5:45
-bash-4.1$ ls'

it means that you open a long string with ' and didn't close it so bash is waiting for string(argument) ended with '

Use ls without any ' at the end.

share|improve this answer

"PS" stands for (probably) "prompt string". PS1 is what the shell would display as your shell process's command line prompt. PS2 is displayed when further input is required to complete the command (unquoted string, reading from stdin, etc.). man bash then search for PS1 or PS2 (/PS[12]<CR>)

share|improve this answer

protected by bwDraco Dec 3 '15 at 10:57

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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