Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 如何通过SSH在终端中执行多个命令?_Shell_Ssh_Raspbian - Fatal编程技术网

Shell 如何通过SSH在终端中执行多个命令?

Shell 如何通过SSH在终端中执行多个命令?,shell,ssh,raspbian,Shell,Ssh,Raspbian,我目前正在通过SSH连接到运行Raspbian的Raspberry Pi Model B。 我试图编写一个脚本,以连续运行多个命令;我希望这两个命令同时运行: arpspoof -i wlan0 -t 192.168.1.1 192.168.1.100 arpspoof -i wlan0 -t 192.168.1.100 192.168.1.1 在Shell脚本中一个命令接一个命令是否允许它们一起运行?您可以使用nohup一起运行这些命令,即: nohup arpspoof -i wlan

我目前正在通过SSH连接到运行Raspbian的Raspberry Pi Model B。 我试图编写一个脚本,以连续运行多个命令;我希望这两个命令同时运行:

arpspoof -i wlan0 -t 192.168.1.1 192.168.1.100 
arpspoof -i wlan0 -t 192.168.1.100 192.168.1.1 

在Shell脚本中一个命令接一个命令是否允许它们一起运行?

您可以使用nohup一起运行这些命令,即:

nohup arpspoof -i wlan0 -t 192.168.1.1 192.168.1.100 > /var/log/logfile1 &
nohup arpspoof -i wlan0 -t 192.168.1.100 192.168.1.1 > /var/log/logfile2 &

非常感谢你!快速提问,“>/var/log/logfile1&”部分是什么意思?抱歉,有点新的提示所有命令行输出都将定向到/var/log/logfile1,如果不设置此部分,它将保存在运行命令的目录中名为nohup.out的文件中