M
M
Max2018-06-14 12:07:44
bash
Max, 2018-06-14 12:07:44

How to make multiline command in terminal?

The problem of writing a long command that does not fit into the entire line on the screen. It is necessary to somehow break this command into several lines. What do I need to do ?
For example, we have a team

[email protected]:~$ curl -X POST "https://google.com" -H "accept: */*"  -d "{ \"Hello\" : \"world\" ,  \"hello2\" : \"world2\"}

I would like to write this in several lines like
[email protected]:~$ curl -X POST "https://google.com"
                                                      -H "accept: */*"
                                                      -d "{ \"Hello\" : \"world\" ,  \"hello2\" : \"world2\"}

PS
I know that you can put a screen version of the transfer \ + enter . But it works for me only with the first transfer :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-06-14
@Maxon4eg92

curl -i -X POST /api/v1/upload \
-H "Authorization: Bearer <TOKEN>" \
-F "[email protected]/home/user/avatar.jpg" \
-F "type=avatar" \
-F "target_id=59a46a496964ab627abdff70"

How can \ + enter not work ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question