2014-07-28

Keep commands even when SSH disconnected (byobu)

Sometimes we need to run a command over SSH, but when SSH session disconnected that command will be also terminated. There are some solution to overcome this, that is create a service, nohup or use terminal multiplexer such as screen or byobu. Using Byobu, you can run multiple commands using single SSH session, the terminal that shown will be appear exactly the same over multiple computer that connected as the same user. To install byobu you can run this command on Ubuntu:

sudo apt-get install byobu

or when using ArchLinux:

sudo pacman -Sy byobu

There are some important shortcut to remember:

  • F2 to create tab (or subsession)
  • F3 to switch to previous tab
  • F4 to switch to next tab
  • F6 to exit from byobu, but the commands would keep running, type byobu on shell to get back to last session
  • shift+F2 to split horizontally
  • ctrl+F2 to split vertically
  • shift+F3/F4 to switch between split region
  • ctrl+F3/F4 to swap between split region
  • alt+PgUp/PgDn to enter scrollback mode (not shift+PgUp/PgDn like normal terminal)
Here's some screenshot about Byobu in action:


No comments :

Post a Comment

THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?