![]() At this point, you’ll be able to use the Arrow keys, Page Up, or Page Down to move around in the output on the screen. To be able to use your cursor keys in tmux so that you can go back in the buffer, press Ctrl+B and then the [ key. ![]() You may notice that if you have text that scrolls past the top of your screen that you cannot simply hit the Page Up key to see it. Other process: 1 windows (created Thu Jan 28 19:50:23 2021) ~]# tmux attach -t "database ~]# Now that we’ve gone over some of the basics of using tmux, let’s see an example of using labels: ~]# tmux new -s "database ~]# tmux new -s "other ~]# tmux lsĭatabase upgrade: 1 windows (created Thu Jan 28 19:50:03 2021) The second example use case above was for labeling the different sessions. For information about using irssi, please see my article Using Irssi inside a Linux tmux session. This connects me by SSH to that remote server and then attaches to my tmux session that I know is there with irssi running. If there are multiple sessions, then you can connect by the number of the session: ~]# tmux lsĠ: 1 windows (created Thu Jan 28 19:58:27 2021) ġ: 1 windows (created Thu Jan 28 20:00:54 2021) Ģ: 1 windows (created Thu Jan 28 20:01:08 2021) ģ: 1 windows (created Thu Jan 28 20:01:39 2021) ~]# tmux a -t ~]#Īn example of how I use this is that the very last command of my personal start script which connects to the VPN and does other things is to run: # /usr/bin/ssh -t tmux attach $ tmux a # this will connect to the most recent session that was created. ![]() To resume the session, I can run: $ tmux ls # to see if there are any other tmux sessions To disconnect from your session, but still leave it running, hit Ctrl+B and then D. This brings you into a tmux session and you’ll be able to run commands and do things just like you normally would as your user. In order to start a basic session, just run the tmux command. If you want to have somebody else see what you’re doing, you can start a tmux session and then have that other person SSH into your system and attach to that tmux session.Going along with that, if you have multiple sessions running, you can use labels for the different sessions.If you have a long-running process, such as an upgrade of an application, and you either don’t want to leave the ssh session running the whole time or you’re concerned that your network connection might drop.Some of the common use cases for this are: ![]() An easy way to demonstrate this is to SSH to a remote system, start tmux, and then from inside of that, start a ping command to a remote system, disconnect from tmux, resume tmux, and you’ll see that the ping is still going. tmux is a terminal multiplexer which means that you’re able to have a process running, disconnect from the system, and then reconnect at a later time and from a different computer so that you can continue working in that process. In version 8, the decision was made to deprecate screen and use tmux instead. ![]() Prior to Red Hat Enterprise Linux 8, the screen command was included.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |