How do I start screen with multiple splits directly from the command line?

Videonauth

I'm using screen after I have logged in with ssh to my server. As of now I set up the splits in my screen window by hand and run the commands by hand as shown in the following screen-shot:

enter image description here

  • The top part should run tail -n 1 -f /home/server/log/access.log.
  • The lower right part should run htop
  • The lower left one should simply be a command prompt

Is there any way to have that be done via commands/script, so I not have to redo it every time by hand?

muru

For the specific case of window arrangements, there's a screen command to save them to a file: layout dump. From man screen:

layout dump [filename]

Write to a file the order of splits made in the current layout. This is
useful to recreate the order of  your  regions  used  in  your  current
layout.  Only  the  current  layout is recorded. While the order of the
regions are recorded, the sizes of  those  regions  and  which  windows
correspond  to  which regions are not. If no filename is specified, the
default is layout-dump, saved in the directory that the screen  process
was  started in. If the file already exists, layout dump will append to
that file. As an example:

           C-a : layout dump /home/user/.screenrc

will save or append the layout to the user's .screenrc file.

So, once you make the arrangement manually, press Ctrla:, then type layout dump /path/to/some/file. The layout will be saved to /path/to/some/file and you can then restore it in a new session with:

screen -c /path/to/some/file

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I start the Privacy and Activity Manager from command line?

From Dev

How do I start the Privacy and Activity Manager from command line?

From Dev

How do I start tty from the command-line?

From Dev

How do I start Telegram from the command line?

From Dev

How do I add multiple "+" commands into less from the command line

From Dev

How do I compile and link multiple files from the command line?

From Dev

How do I FTP multiple files from the command line?

From Dev

How do I add multiple "+" commands into less from the command line

From Dev

how do I make a python program write directly to the command line?

From Dev

How do I start emacs from the command line but use emacsclient if a server is already running?

From Dev

How do I start "Ubuntu classic desktop" (no effects) from the command line

From Dev

How do I start "Ubuntu classic desktop" (no effects) from the command line

From Dev

How do I lock the desktop screen via command line?

From Dev

How can I blank the screen from the command line over SSH?

From Dev

How can I blank the screen from the command line over SSH?

From Dev

How do I stop multiple line output from command substitution from being concatenated in BASH script?

From Dev

How can I start octave from the command line and not the GUI?

From Dev

How do I start multiple terminals inside NeoVim with one command?

From Dev

How do I open a new command line window from an sh script and then pass in multiple commands

From Dev

How do I execute a command in an iTerm window from the command line?

From Dev

How do I pass a username to an FTP command from the command line?

From Dev

vim horizontal and vertical splits from command line

From Dev

Screen - Do command on start

From Dev

Screen - Do command on start

From Dev

How do I easily rename multiple files using command line?

From Dev

How do I easily rename multiple files using command line?

From Dev

How do I zip up multiple files on command line?

From Dev

How do I edit previous lines in a multiple line command in Bash?

From Dev

How do i execute multiple commands sequentially on the command line?

Related Related

  1. 1

    How do I start the Privacy and Activity Manager from command line?

  2. 2

    How do I start the Privacy and Activity Manager from command line?

  3. 3

    How do I start tty from the command-line?

  4. 4

    How do I start Telegram from the command line?

  5. 5

    How do I add multiple "+" commands into less from the command line

  6. 6

    How do I compile and link multiple files from the command line?

  7. 7

    How do I FTP multiple files from the command line?

  8. 8

    How do I add multiple "+" commands into less from the command line

  9. 9

    how do I make a python program write directly to the command line?

  10. 10

    How do I start emacs from the command line but use emacsclient if a server is already running?

  11. 11

    How do I start "Ubuntu classic desktop" (no effects) from the command line

  12. 12

    How do I start "Ubuntu classic desktop" (no effects) from the command line

  13. 13

    How do I lock the desktop screen via command line?

  14. 14

    How can I blank the screen from the command line over SSH?

  15. 15

    How can I blank the screen from the command line over SSH?

  16. 16

    How do I stop multiple line output from command substitution from being concatenated in BASH script?

  17. 17

    How can I start octave from the command line and not the GUI?

  18. 18

    How do I start multiple terminals inside NeoVim with one command?

  19. 19

    How do I open a new command line window from an sh script and then pass in multiple commands

  20. 20

    How do I execute a command in an iTerm window from the command line?

  21. 21

    How do I pass a username to an FTP command from the command line?

  22. 22

    vim horizontal and vertical splits from command line

  23. 23

    Screen - Do command on start

  24. 24

    Screen - Do command on start

  25. 25

    How do I easily rename multiple files using command line?

  26. 26

    How do I easily rename multiple files using command line?

  27. 27

    How do I zip up multiple files on command line?

  28. 28

    How do I edit previous lines in a multiple line command in Bash?

  29. 29

    How do i execute multiple commands sequentially on the command line?

HotTag

Archive