Well, not knowing what other explanations you've read but don't understand/grasp makes it a bit difficult to narrow down specifics, though to start from the beginning, tmux is a terminal multiplexer, what that means is that it will allow multiple sessions running concurrently under the same virtual terminal. It provides keyboard shortcuts to switch between them, or split them and display them concurrently.
The biggest use case for me however (though I use an older one called screen out of hard to shake habits) is the ability to detach and attach at will, so that any disconnected remote sessions won't kill whatever I happen to be working on. Alternatively, I can have running sessions locally on my current machine and then I can go elsewhere and remote in and resume from where I've left off.
A somewhat frowned upon use case is to use it to run "background" processes on a remote server - like a development web service that you just can't be bothered to properly package/daemonize - just open screen or tmux, start it, and detach the session and it should stay running barring any other problems.
A somewhat frowned upon use case is to use it to run “background” processes on a remote server
in most cases screen/tmux is an overkill, I prefer using setsid for quick and dirty scripts, it just starts a process in a new session, detached from parent terminal. Or nohup when I need to check the output. Both available on most linux systems by default.
I use screen still too, partly because it’s generally installed on everything already, like vim. I hardly ever use anything but a maximised (i.e. full-terminal) screen at once, so it doesn’t sound like I’m missing much from tmux.
De/reattaching’s extremely useful and another thing I really like in screen is being able to scroll and search the scrollbuffer.
If I was ready for an upgrade, I’d probably go for zellij.
I guess the best analogy is a "virtual desktop" but for the terminal.
It's is a program which runs in a terminal and allows multiple other terminal programs to be run inside it.
Each program inside tmux gets its own "page" or "screen" and you can jump between them (next-screen, previous-screen etc).
So instead of having multiple terminal windows, you only have one and switch the screen/page inside it.
You can detech from the program and leave it running - so next time you log on to the server, you can re-attach to it and all your screens/sessions are still there.
Not super useful on your local machine - but when you have to connect to a remote server (or several) is really shines. Especially if you have to go through a jumphost. You can just connect to your jumphost, start tmux, then create a "screen" for each server you need to connect to - do your stuff and deattach. Next time, just re-attach and all your stuff is there.
Ok, now I guess I am seeing the value of it, specially with the “virtual desktop” analogy and the remote scenario, since I need to do some of it at work and having everything as I left it last time will be nice. Thank you!
Imagine you ssh into a server to do a database import, and from previous experience you know it will take about 3 hours. You start the restore, then get up to make dinner. You come back an hour later and realize you forgot to plug your laptop in.
Is the import command still running? Who knows.
With tmux you just charge your laptop, ssh in again, and reconnect to the virtual term that was running the command to check.
You can also split windows to have multiple terminals side by side, or above below each other. Many use it locally as a tileing window manager when their main terminal or window manager does not support tiling.
I actually get a lot of use out of it locally. I usually have multiple sessions for different concerns and prefix + s lets me switch between them quickly using vi keybindings. I can even do prefix + w to switch to a specific window in a different session.
I don’t use vscode much lately, but when I did it was also useful sometimes to have the same window in my terminal client on one desktop and in vscode’s terminal on another when switching back and forth a lot to see a browser or database client or whatever. Just having the freedom to move the session around to different applications is nice.
Ugh I remembering learning upstart and getting decent with it and then everyone went “nope, systemd”
Let’s just improve what we have and not change the whole goddamn thing again. That’s more annoying.
Also, some of the people on hackernews are so cringy. Like, dude we get it there is a bad default. Make your case and stop being a total jerkoff, because no one is going to listen to that guy and I bet that’s like 20% of the reason the other übernerds are digging their heels in about changing it.
Probably somebody can provide a better answer, but for me tmux is useful due that it has session manager (really useful if your remote connection drops) and the ability to split the screen in multiple screens (usually I split vertical, but you can create easily 4x4 screen).
The only trick is the learning curve of the actions (usually ctrl + b and the key required). For example to split the window vertical, you must do ctrl + b and then %.
But as I said, probably you will get better and more technical answers ^_^U
The irony is that once you find your way around through the default keys and search a little you soon discover how easy it is to reset them with “sane” settings. Same for window frames, etc. But yes, there’s definitely a learning curve.
I’m a /home on separate drive/partition kind of guy. I like it just following my installs. Though seeing some using guix/nixos to create a config for my desktop has got me wanting to spend a weekend trying that out.
The rest, ansible for any sufficiently complex enough setup at the moment. Good for integration work with LDAP, etc if your using that. Again may play around with guix on that front.
I was just thinking yesterday when looking at how NixOS works. The config file seems to be quite reminiscent of an Ansible Playbook. I mean maybe I’m way off the mark, I haven’t really dug into Nix much yet.
Guix/nix seem very powerful. The reproducibility is something ansible just isn’t built to same level robustness for, which makes them seem very promising to me.
I’ve been using chezmoi for dotfile management and have been really happy with it. You can directly import existing files to get started and template out any differences between systems.
Only one thing: never give up. You’ll get things fixed by copy and paste until one day youll have a broken system and think wait I actually know how to fix this because I’ve been through it five times before.
Who needs time shift when you can just slowly break your system while trying to fix a bug and then just either reinstall the os or switch to a different distro bc might as well
It is indeed, I tried to go straight WM (i3) but I’m not used to it so I installed xfce which I’m familiar with (I’m also using it on my server running Lubuntu).
I can’t confirm that (I distro hopped to NixOS) I can confirm that Arch is a solid distro worth learning and will give you the skills to manage it long-term. Compared to Arch based distros like Manjaro, EndeavorOS and Garuda where people tend to screw up their install easily when installing the wrong packages from the AUR and updating with dependency conflicts.
I tried manjaro, it was a total mess after a few days of setting it up. Decided to just nuke it and go with arch and I’ve never looked back. Been 5 years now :)
linux
Hot
This magazine is from a federated server and may be incomplete. Browse more on the original instance.