W
W
weranda2020-08-03 20:57:25
zsh
weranda, 2020-08-03 20:57:25

How to pass two or more commands in sequence in iTerm / zsh?

Greetings.
There is iTerm. It has a setting for launching a command when creating a profile:
5f284f8146b57451405652.png
Is it possible to enter two or more commands in this field so that the second one is launched after the first one is executed, and so on? What options are there?
Needed to quickly connect via SSH > go to the desired folder > run the file...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-08-03
@gebrak

Option for working with ssh (connect, change to directory, start bash): If you only need to execute commands on the server: Several consecutive commands, while the second command will be executed only if the first one succeeds: Several consecutive commands that will be executed without success check previous command:
ssh -t [email protected] "cd /home/user/ && bash -l"
ssh [email protected] "date && hostname"
date && hostname
date; hostname

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question