linux tmux send -t 如何使用
时间: 2023-04-10 15:03:31 浏览: 114
您可以使用以下命令来发送消息到指定的 tmux 会话:
tmux send -t [target-session] [message]
其中,[target-session] 是您要发送消息的 tmux 会话的名称或 ID,[message] 是您要发送的消息内容。例如,如果您要向名为“my-session”的 tmux 会话发送消息“Hello, World!”,则可以使用以下命令:
tmux send -t my-session "Hello, World!"
请注意,您需要在 tmux 会话中运行此命令,或者使用 -t 选项指定要发送消息的会话。
相关问题
gnome-terminal --tab -e "ssh t512 -t 'tmux new-session -d -s bag; tmux send-keys -t bag "source /etc/trunk/env.sh;cd /home/trunk/scripts/ ; bash data_rec.sh " ENTER'" --tab -e "ssh t503 -t 'tmux new-session -d -s bag; tmux send-keys -t bag "source /etc/trunk/env.sh;cd /home/trunk/scripts/ ; bash data_rec.sh " ENTER'"
这是一个使用 gnome-terminal 命令来打开两个终端窗口并分别连接到远程服务器 t512 和 t503。连接后,会使用 tmux 命令创建一个名为 bag 的会话,并在其中运行 data_rec.sh 脚本。其中 source /etc/trunk/env.sh 用于加载环境变量,cd /home/trunk/scripts/ 用于进入到脚本所在的目录。这段命令的作用可能是用于在远程服务器上启动数据接收程序。
system("tmux send -t 0.0 'python iis.py' ENTER") send -t 0.0是什么意思
send -t 0.0 是 tmux 命令中的一个选项,它表示将命令发送到会话 ID 为 0,窗口 ID 为 0 的窗格中执行。在这个例子中,命令是将字符串 'python iis.py' 发送到 tmux 会话中,并模拟按下 ENTER 键以执行该命令。