Sign up ×
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.

I often use the space-backslash combination ( ) to split a command and its parameters into various lines and make it more readable:

/home/user> ls -ltra \
> file1.txt \
> file2.txt

Recently I used an instruction with a similar format on my terminal window. Since I was going use the same files in various instructions, I decided to highlight\copy the whole command with my mouse and paste them in an open editor.

  1. I only highlighted with my mouse the two file lines and
  2. pasted them by mistake into the same terminal window:

Like this:

/home/user> > /home/user/file1.txt
> > /home/user/file2.txt

They system thought I was overwritting the files. The data was lost. Fortunately, there was backup!

Now my question:

Can a terminal session be re-configured so it uses a symbol, other than the > sign, at the start of a split command? Something which won't have such horrendous consequences.


/home/user> ls -ltra \
# file1.txt \
# file2.txt


I am using Korn shell (/usr/bin/ksh) on a Solaris server. Korn is the company's default shell.

share|improve this question
Just tried changing the PS2 variable to '# ' and it works in Korn. Thank you for the information. –  lamcro Jul 11 '14 at 19:30

2 Answers 2

up vote 3 down vote accepted

If you're using a sh-compatible shell (like bash), that > prompt is called the "secondary prompt". It's set by the value of the PS2 variable, just like PS1 sets the normal prompt.

You should be able to change it to # pretty easily:

PS2='# '

You might want to put that into your ~/.bashrc (or whatever the equivalent is for whatever shell you're using).

share|improve this answer

It's not based on "the system". It's based on your shell.

In bash or other Bourne shells

   PS2    The  value of this parameter is expanded as with PS1 and used as
          the secondary prompt string.  The default is ``> ''.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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