Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to create a bash script to automatically open a screen window with 4 sessions running predetermined commands. I'd like to open htop and slurm on the top two frames, squidview in the middle large frame and a blank terminal on the bottom large frame. Is this possible to set up with a single bash script?

share|improve this question
up vote 3 down vote accepted

This does something like you desire:

$ cat my_screenrc
screen top 
focus down
screen vmstat 1
focus down
focus bottom
$ screen -c my_screenrc

screen appears to be more directed toward screen flipping than multiple panels and the documentation is pretty arcane.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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