Project

General

Profile

Feature #524

Running Detatched Terminal Sessions

Added by Daniel Curtis almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/02/2015
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

Description

From time to time I need to compile a program and close my ssh session, and doing this will kill all running processes spawned from the session it was created from. Luckily there is a handy tool called tmux that will keep processes launched from within the tmux session from dying, even after logging out (as long as the system is running).

h1 Tmux

Install tmux

  • On Debian/Ubuntu
    apt-get install tmux
    
  • On Arch
    pacman -S tmux
    
  • On FreeBSD
    pkg install tmux
    

Running tmux

  • Once installed, spawn a tmux session:
    tmux
    
  • Now run what ever process that takes a long time:
    cd /usr/src/project
    make
    
  • While the process is running press Ctrl + b, then d.
  • Then reattach the session to view its progress:
    tmux attach
    
  • To list the running tmux sessions, run:
    tmux list-sessions
    

Screen

Install screen

  • On Debian/Ubuntu
    apt-get install screen
    
  • On Arch
    pacman -S screen
    
  • On FreeBSD
    pkg install screen
    

Running screen

  • Once installed, spawn a tmux session:
    screen
    
  • Now run what ever process that takes a long time:
    cd /usr/src/project
    make
    
  • While the process is running press Ctrl + a, then d.
  • Then reattach the session to view its progress:
    screen -r
    

Also available in: Atom PDF