Is there a way I can input these two commands into a new terminal at the same time?
( konsole -e sudo nethogs
sudo sysctl net.ipv4.ip_forward=1 )
Is there a way I can input these two commands into a new terminal at the same time?
( konsole -e sudo nethogs
sudo sysctl net.ipv4.ip_forward=1 )
I think what you want to do with konsole
is the following:
$ konsole -e "sudo sysctl net.ipv4.ip_forward=1; sudo nethogs" --noclose --hold
This will invoke konsole
and then run commands within it, -e
. In this case we're running the 2 sudo
commands and we're using the --noclose
& --hold
to tell konsole
to keep the window open while these run.
konsole -e "sudo whoami; sudo whoami" --noclose --hold
to see what the issue might be more easily.
konsole -e "sudo whoami; sudo whoami;bash"
-- The final bash
will make the konsole
window stay instead of close immediately after finishing the previous commands.
To send several commands to different terminals simultaneously one easy way could be with byobu:
Press Ctrl+F2 to vertical split, then Shift+F9: