I have lots of servers written in Python. I want to run them, one script per one terminal tab. I'm using Xubuntu 16.04.

I know how to open the terminal tab in Xubuntu inside the bash script:

xfce4-terminal --tab

Also, I know how to run python script in bash script:

python server_1.py

But how can I open a new tab, and run the script in this new, opened tab?


There are the -x and -e options, have you tried them?

-x, --execute
    Execute the remainder of the command line inside the terminal
-e, --command=command
    Execute command inside the terminal

Ie. something like:

xfce4-terminal --tab --execute python server_1.py

If there is a problem with the skript path, you can specify the working directory with:

  • I have weird errors when trying the --working-directory=directory (terminal has closed immediately) but the -x option works. Thank you for help. – mirx Mar 31 '17 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.