I'm just wondering is there a way to enter a new line in iTerm 2 without executing the line being typed? I am looking to make use of some relatively long commands to automate some things, but not being able to format things is proving to make long commands hard to read.

Is there any way to enter line breaks or soft returns so that when enter is pressed the whole command will still execute?

  • If you want to automate something, you could write a script. – Arc676 Dec 8 '15 at 5:06

Not sure if I understand correctly. If you put \ at the end and press enter, it is treated as continuation of the line and control goes to next line for you to type more. Only when you press enter on a line that doesn't end in \ is when the entire piece of code gets executed on the shell. So in a way \ could be you soft return.

| improve this answer | |
  • What if the line starts with # (it is an inline comment)? – Charlie Gorichanaz Apr 12 '18 at 18:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .