The free Linux tool that keeps your terminal sessions alive forever


Even though most Linux distros don’t require as much time in the terminal as they used to, eventually, it is going to come up. If you’re doing anything remotely, executing a long task, or even just multitasking, the default tools may not be enough. That is where tmux comes in.

Terminal sessions weren’t designed to last forever

End the job when the window closes

A Linux terminal open in Ubuntu with the vim editor editing the .bashrc file. Credit: Jordan Gloor / How-To Geek

Most of the time when you’re doing something in the terminal, that activity is tied directly to the terminal. For example, if I’m hosting a Minecraft server and I run the server executable, then that instance of the server depends on that specific terminal window. If I close it, the Minecraft server shuts down with it.

This applies to pretty much anything you do with the terminal—moving large files, SSH connections, searches, any executable that runs, system monitors, and more. Unless you specifically do something to make the job persist after the terminal is closed, they’ll stop when the terminal closes.

In some cases, that can be a good thing. If a program freezes, you can just close the terminal to forcibly quit. You also don’t want a demanding application quietly running in the background by accident without you realizing.

Konsole Terminal open on the Kubuntu Focus Ir14 Linux laptop.


How to Use the htop Command on Linux

More than just a pretty face.

On the other hand, it is a problem if you need something to keep going. It is particularly annoying when you’re doing remote administration, and you want a job to keep running after you disconnect from the SSH session.

Screen solved the problem a long time ago

Screen is an application that was built decades ago to address the problem, and it generally works pretty well. However, Screen is a product of its time. When you need something very lightweight and included by default, it is a good option. If you need something with more features, there is a more modern application: Tmux.

Tmux allows terminals to last as long as you need

It does everything screen does and more

Tmux is a terminal multiplexer that allows you to easily swap between applications in one terminal window, or detatch terminals virtually so they can keep running in the background and then reconnect later.

If you’re doing any kind of remote management, or you’re using a PC that is command-line only—like a headless Ubuntu server that you have a monitor and keyboard attached to—then it is a fantastic option.

No more closed servers

Originally, I started using tmux because my Minecraft server would shut off anytime I ended the SSH connection. That was a problem, since restarting my PC, a Windows update, or even accidentally closing the Terminal window kills the SSH connection.

Now, I just create a new tmux session as soon as I connect to my Minecraft server. For example, I might run:

tmux new -s mcserver

Anything I run within that session will stay running even when I disconnect. Whenever I want to come back to do something—like restart the server or access the admin panel—I just need one command.

tmux attach-session -t mcserver

You’re not limited to hosting servers, either. Any time you think a process might take longer than a few minutes (like copying a large number of files) I’d recommend using a tmux session. It ensures you won’t accidentally interrupt some process in the middle.

You have a long history of your actions

Every terminal out there keeps a running log of the things you enter. That serves multiple purposes.

If a command you enter accidentally breaks something, you’re not left wondering about the details—you can just check what you did. That makes troubleshooting easier. Alternatively, if there is an elaborate command you find yourself running a lot, you don’t need to type the entire thing in over and over again. You can just go back in your history then tap Enter to run the same command again.

One of the advantages of tmux, which I’ve found to be especially helpful on my home server, is the extensive history. By default, it’ll save several thousand commands. You can also change that limit by editing the .tmux.conf file, which is located in your user directory.

Tmux makes multitasking better

Besides its ability to ensure that you don’t lose a task in progress when you close a window or exit SSH, tmux is also handy for general multitasking.

If you’re using a Linux distro with a graphical user interface (GUI), multitasking isn’t a problem—you can just open up another terminal if you need one. However, if you’re working on a system that doesn’t have a GUI, you don’t have that option. Tmux allows you to open any number of sessions so that you can easily switch between tasks whenever you want, even if a process running in one session will take three hours and the other will finish in 30 seconds.


Tmux is an essential tool for anyone self-hosting

Regardless of what fancy dashboards you set up, if you’re self-hosting, you’re eventually going to have to work using the command line. Tmux is one of those tools you won’t need to use all the time, but when it becomes necessary, you’ll be very glad to have it.

Dell XPS 13 Plus 2023

Operating System

Ubuntu Linux 22.04 LTS

CPU

13th Gen Intel Core i7-1360P




Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


spring-sale-imagery

DeWalt/ZDNET

Spring means lawn and garden prep and DIY projects around the house. And if you’ve been looking for a handy gadget to help you with small repairs and crafts, you can pick up the DeWalt MT21 11-in-1 multitool at Amazon ahead of its Big Spring Sale for 25% off, bringing the price down to $30 (matching the lowest price of the year so far). It also comes with a belt sheath to keep it close by on jobsites.

Also: 10 DIY gadgets I never leave out of my toolkit

The MT21 has a compact design, measuring just 4 inches when fully folded and expanding to 6 inches when the pliers are deployed. The hinged handle is made of durable steel with a rubberized grip in iconic DeWalt yellow and black, adding a bit of visual flair while making the multitool more comfortable to use. Each of the included tools is also made of stainless steel for strength and reliability on jobsites and in the garage.

Also: The best Amazon Spring Sale DeWalt deals

The 11 featured tools include: regular and needlenose pliers, wire cutters, two flathead screwdrivers, a Phillips screwdriver, a file, a can and bottle opener, a saw blade, a straight-edge blade, and an awl tool. Each tool folds into the handle to keep them out of the way until needed and to protect your hands while using the multitool. 

We’re big fans of multitools here at ZDNET, and definitely recommend this highly rated one from DeWalt.

How I rated this deal 

DeWalt is one of the leading names in power tools, and if you’re looking for a handy EDC gadget or just need something for occasional DIY repairs, the MT21 multitool is a great choice. With 11 tools in a single gadget, you can do everything from assembling flat-pack furniture to minor electrical repairs. While not the steepest discount, getting your hands on a high-quality multitool for 25% off is still a great value. That’s why I gave this deal a 3/5 Editor’s rating.

Amazon’s Big Spring Sale runs March 25-31, 2026. 


Show more

Deals are subject to sell out or expire anytime, though ZDNET remains committed to finding, sharing, and updating the best product deals for you to score the best savings. Our team of experts regularly checks in on the deals we share to ensure they are still live and obtainable. We’re sorry if you’ve missed out on this deal, but don’t fret — we’re constantly finding new chances to save and sharing them with you at ZDNET.com


Show more

We aim to deliver the most accurate advice to help you shop smarter. ZDNET offers 33 years of experience, 30 hands-on product reviewers, and 10,000 square feet of lab space to ensure we bring you the best of tech. 

In 2025, we refined our approach to deals, developing a measurable system for sharing savings with readers like you. Our editor’s deal rating badges are affixed to most of our deal content, making it easy to interpret our expertise to help you make the best purchase decision.

At the core of this approach is a percentage-off-based system to classify savings offered on top-tech products, combined with a sliding-scale system based on our team members’ expertise and several factors like frequency, brand or product recognition, and more. The result? Hand-crafted deals chosen specifically for ZDNET readers like you, fully backed by our experts. 

Also: How we rate deals at ZDNET in 2026


Show more





Source link