bash tmux screen nohup - ghdrako/doc_snipets GitHub Wiki

nohup

By default,nohup appends all output to a file named nohup.out.

# Run a command with nohup and send its output to a file
nohup python3 long_running_script.py &
# Run a command with nohup, discarding both stdout and stderr
nohup python3 long_running_script.py > /dev/null 2>&1 &

Tmux

  • https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ All commands in tmux are triggered by a prefix key followed by a command key - + b press - press at the same time

  • C-b % split your single pane into a left and a right pane(horizontally) - release C-b prefix key and press commnd key b

  • C-b " — Split the window into two panes vertically.

  • C-b - navigate pane

  • Ctrl-d or exit - closing pane

  • C-b c - new window

  • C-b p - switch to previous window

  • C-b n - switch to next window

  • C+B 0 (1,2...) — Move to a specific window by number.

  • C-b d - detatch current session

  • C-b D - detatch choosing session

  • C-b ? - list avaliable command

  • C-b z: make a pane go full screen. Hit C-b z again to shrink it back to its previous size

  • C-b C-: Resize pane in direction of 4

  • C-b ,: Rename the current window

  • tmux ls - List the currently running sessions

  • tmux attach -t 0 - attach to session 0

  • tmux new -s database - create new session with name

  • tmux rename-session -t 0 database

⚠️ **GitHub.com Fallback** ⚠️