Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Add FAQ: "How do I use tmux to keep programs running?" #266

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions content/en/linux/using-tmux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "How do I use tmux to keep programs running?"
type: docs
tags:
- SSH
- Ubuntu
---

You can use the program `tmux` to keep programs and commands running after you
log out of a server or
[Cloud instance](https://lambdalabs.com/service/gpu-cloud). This is useful,
for example, when
[copying a large amount of data directly between servers or Cloud instances using `rsync`](https://rsync-to-copy-and-synchroniz.lambda-docs.pages.dev/linux/rsync-to-copy-and-synchronize/).

To use `tmux`, first install `tmux` on the server or Cloud instance by
running:

```bash
sudo apt -y update && sudo apt -y install tmux
```

Then, run the command `tmux` to create a `tmux` session. In the `tmux`
session, run commands like you normally would.

When you're ready to log out of the server or Cloud instance, press **Ctrl** +
**b**, then press **d**. You'll "detach" from the `tmux` session and can
safely log out of the server or Cloud instance.

To reattach to the `tmux` session, first log into the server or Cloud
instance. Then, run `tmux attach`.

{{% alert title="Tip" color="success" %}}
`tmux` has many useful features, such as the ability to create multiple panes
to run commands in. See the [`tmux` wiki](https://github.com/tmux/tmux/wiki)
to learn more about the features and customization options available in
`tmux`.
{{% /alert %}}