A bash environment variable, similar to PS1. It is your "secondary" prompt (whereas PS1 is your "primary"). The difference is that PS1 is what it gives you when it's asking for a command, and PS2 is what it gives you when it's in the process of accepting a multi-line command. For example, let's say you were giving it the command:
echo "This is line one of this echo
This is line two of this echo" > random_file
When you started typing line one, you would be typing into PS1, and when you started typing line 2 (or any subsequent lines, for that matter), you would be typing into PS2.

To see what your PS2 looks like, type echo $PS2

To change your PS2, type PS2="new_ps2_value"
People usually do this in their bashrc file.

PS2 usually contains nothing but "> ", but you can use any of the escaped commands given in the PS1 node.

Log in or register to write something here or to contact authors.