Tmux in 100 Seconds

The Only Bamboo
242 followers
9 Video Views·Mar 20, 2026
Learn the basics of Tmux, an open-source terminal multiplexer that can juggle multiple terminal sessions from a single window.
💬 Chat with Me on https://discord.gg/fireship
🔥 Get More Content - Upgrade to PRO
These tmux tips are part of my full Linux course, which you can access by upgrading to PRO.
Upgrade at https://fireship.io/pro
Use code TMUX2024 for 30% off PRO access ,
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
AI Generated·May contain errors
Tmux, an open source terminal multiplexer that can juggle multiple terminal sessions from a single
window. It was created by Nicholas Marriott in 2007 after becoming frustrated with the
limitations of GNU Screen, and is offered under the more permissive BSD license. As you can see
here, I'm building some crappy software, and I have a terminal window open for a web server,
one for Postgres, one for my Nginx logs, one for Htop, one for Nano, and one for Repel to say
hello world. It's complete chaos, but things get a lot better if I run this tmux command first.
Which will summon this magic little status bar. Now I can take all these terminals and combine
them into a single window where they're organized in the status bar like an array. I can easily
navigate between them without ever touching the mouse, split them into panes both horizontally
and vertically, and can give each one of them a custom name. And if I accidentally closed it,
all is not lost because the session is still running in the background. Also, if you're
constantly switching between multiple failed side projects, it's time consuming to manually
resurrect a bunch of terminal windows to set up your environment. Tmux can be controlled with
scripting to define sessions programmatically. With just a few lines of bash code, we can
instantly fire up multiple terminals for our project, with descriptive names and fancy colors.
But you don't even have to do it all from scratch because tmux has a bunch of pre-built plugins,
like resurrect will restore your environment after reboot, or use powerline to customize it in ways
that would make even the most flamboyant peacock jealous. To get started, install it on any Unix
like machine, including macOS, Linux, and WSL, then open up a terminal window and start a new
session. Go ahead and run any random process, then create a new terminal window by hitting
ctrl bravo, let go, then hit charlie. A new terminal is pushed onto the stack, and we can
navigate between them with ctrl b followed by their index number. We can also navigate with
the arrow keys, or split these terminals into panes with quote for vertical or percent for
horizontal. Pretty cool, but oh no, I just closed it. But it didn't actually die, it only detached
from reality. If we open up the terminal, we can run tmux ls to list out all the active sessions.
When we find the one we're looking for, we can reattach to it and get back to work. What's really
awesome though, is that if we create a bash script, we can do all this programmatically. Let's define
a variable for session name, and then first check to see if that session already exists with the
tmux has session command. If it exists, then we can simply reattach to it. Otherwise we'll use the
new session command to create a new one, with the initial window handling our text editor. From there
we can tell tmux to cd into the project directory and run vim. Just kidding, we'll run nano because
it's far superior. But now let's open up another window called server. It'll cd into that same
project and run some javascript slop. We might also need a window to run a docker container,
another one for the database, and another one for logging. That takes care of our windows,
but let's also customize the color and appearance. And then finally, we'll use select window to focus
on the editor first. Now open the terminal and run the script to work smarter and not harder.
This has been tmux in 100 seconds. This video is a part of my full linux course, which is available
for firechip pro members. If you want to learn everything you need to know about linux and
self-hosting your own virtual private server, try it out for free and use this discount code
to upgrade. Thanks for watching and I will see you in the next one.
