Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I attach an unnamed tmux session?

Tags:

ubuntu

tmux

tmux ls gives me the following result:

ubuntu@ip-10-x-y-z:~$ tmux ls
0: 1 windows (created Wed Aug 23 08:35:32 2017) [112x51]
1: 1 windows (created Wed Aug 23 09:06:27 2017) [112x51]

How do I attach the the first one in the list?

like image 385
Dawny33 Avatar asked Sep 20 '25 15:09

Dawny33


2 Answers

Your own answer is one way, with -t.

If you are already in one tmux session, you can PREFIX+s to let tmux show you a session list, thus, you can select the session you want to attach.

Or just tmux attach to attach the first session, then do the above step.

like image 137
Kent Avatar answered Sep 23 '25 04:09

Kent


I have figured out the answer:

tmux attach -t 0

0 and 1 are the pid's of the sessions and they can be attached using those pid's after the attach command.

like image 33
Dawny33 Avatar answered Sep 23 '25 05:09

Dawny33