Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I enter multiple lines in an OSX terminal? [duplicate]

Tags:

bash

shell

macos

How can I enter multiple lines in a terminal ? I would like to do the same thing as when I do shift + enter in chrome.

like image 616
Lev Avatar asked Jan 31 '18 10:01

Lev


People also ask

How do I type multiple lines in Terminal Mac?

To enter multiple lines before running any of them, use Shift+Enter or Shift+Return after typing a line. This is useful, for example, when entering a set of statements containing keywords, such as if ... end.

How do you copy multiple lines in Terminal?

Place the cursor on the first line of the text you wish to copy. Type 12yy to copy the 12 lines. Move the cursor to the place where you wish to insert the copied lines. lines after the current line on which the cursor is resting or type P to insert the copied line before the current line.

How do you make a new line in Terminal?

The most used newline character If you don't want to use echo repeatedly to create new lines in your shell script, then you can use the \n character. The \n is a newline character for Unix-based systems; it helps to push the commands that come after it onto a new line.


1 Answers

End your line with a backslash (\), hit Enter, and continue typing on the next line.

Keep in mind that if you need spaces between the parts of your command, you need to enter them explicitly, e.g.:

ls \
-la
like image 137
Robby Cornelissen Avatar answered Sep 29 '22 08:09

Robby Cornelissen