{"id":87,"date":"2025-12-20T17:29:06","date_gmt":"2025-12-20T17:29:06","guid":{"rendered":"https:\/\/pipeawk.com\/pipeawk\/?p=87"},"modified":"2025-12-20T17:31:24","modified_gmt":"2025-12-20T17:31:24","slug":"demystify-multitasking-terminal-with-the-tmux-utility","status":"publish","type":"post","link":"https:\/\/pipeawk.com\/index.php\/2025\/12\/20\/demystify-multitasking-terminal-with-the-tmux-utility\/","title":{"rendered":"Demystify Multitasking Terminal with the TMUX Utility"},"content":{"rendered":"<p>Let&#8217;s talk today about the very useful utility called\u00a0<strong>tmux<\/strong>. After reading this post, you will know what tmux is, why and how you use it, and a few tricks to\u00a0 make the experience better.<\/p>\n<p>Let&#8217;s start with the question, what is tmux? Just like the name implies, tmux stands for teminal multiplexer, it has for all practical purposes, replaced the older but similar utility called\u00a0<strong>screens<\/strong>. Once you start tmux, you are welcomed by a similar screen as before, the only difference is the task bar located at the bottom. Let&#8217;s see it in\u00a0 action.<!--more--><\/p>\n<p>To launch tmux, you simply issue the command tmux from the $ prompt, you are welcomed by a screen similar to the following:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-381 size-large\" src=\"https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen-1024x528.png\" alt=\"\" width=\"840\" height=\"433\" srcset=\"https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen-1024x528.png 1024w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen-300x155.png 300w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen-768x396.png 768w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen-1536x791.png 1536w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen-1200x618.png 1200w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/initial-tmux-screen.png 1974w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>At this point, the session, unless intentional terminated, or the system is rebooted, it will outlive your login session. At this point let&#8217;s discuss attaching and detaching from a tmux session. Detaching simply means that the session will continue to run, but in the background, for example, you could start a long process and if you detach, or you are disconnected from the system, you can re-login and attach to the existing sessions. Worth mentioning here is that you can have multiple sessions running simultaneously. Each session is independent from another.<\/p>\n<p>The default detach key sequence is CTRL-B followed by D for detach. At this point you can issue the following command:<\/p>\n<blockquote><p>tmux ls<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-382\" src=\"https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple-1024x528.png\" alt=\"\" width=\"840\" height=\"433\" srcset=\"https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple-1024x528.png 1024w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple-300x155.png 300w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple-768x396.png 768w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple-1536x791.png 1536w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple-1200x618.png 1200w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-ls-multiple.png 1974w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>The screenshot above depicts two running simultaneous sessions, &#8220;0&#8221; and &#8220;1&#8221;. Sessions can be named, the incremental number is the default id assignment; the -t option allows you to name the session at will.<\/p>\n<p>To\u00a0<strong>attach<\/strong> to a running session, you will issue a command similar to the following:<\/p>\n<blockquote><p>tmux attach -t 0<\/p><\/blockquote>\n<p>The command line argument\u00a0<strong>-t<\/strong> specifies the session to attach to, if only one session is running, the -t is not required, tmux will attach to the only running session.<\/p>\n<p>Now the light bulb should start going and you can imagine many possibilities with how tmux can be useful, seasoned systems admins use it, developers use it, etc.<\/p>\n<p>I believe this is a good stop point for the basics. I will write another post for the advanced uses. For example you could setup key binding overrides and plugins, and have something like this when you start tmux:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-387\" src=\"https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env-1024x528.png\" alt=\"\" width=\"840\" height=\"433\" srcset=\"https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env-1024x528.png 1024w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env-300x155.png 300w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env-768x396.png 768w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env-1536x791.png 1536w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env-1200x618.png 1200w, https:\/\/pipeawk.com\/wp-content\/uploads\/2025\/12\/tmux-dev-env.png 1974w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Thank you for staying with me until the end. I hope you now better understand tmux.<\/p>\n<p>Happy reading and type away&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s talk today about the very useful utility called\u00a0tmux. After reading this post, you will know what tmux is, why and how you use it, and a few tricks to\u00a0 make the experience better. Let&#8217;s start with the question, what is tmux? Just like the name implies, tmux stands for teminal multiplexer, it has for &hellip; <a href=\"https:\/\/pipeawk.com\/index.php\/2025\/12\/20\/demystify-multitasking-terminal-with-the-tmux-utility\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Demystify Multitasking Terminal with the TMUX Utility&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-unix"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":13,"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":390,"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/posts\/87\/revisions\/390"}],"wp:attachment":[{"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pipeawk.com\/index.php\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}