Ending all tmux sessions at once

How do I end all tmux sessions with a command? I do know that Ctrl+D detaches the current session and "exits" in a window. But the server process does not end until the last bit is closed.

Suppose there are 3 sessions with 4 windows each open. I want to close all sessions and restart tmux fresh in a proper way (i.e. not killing the server).

Is there any way to do this?

3

1 Answer

This can be done in the following way.

Create a new session named "new":

tmux new-session -s new

Kill all sessions except the one you just created:

tmux kill-session -a -t new

However, killing the tmux server and starting a new session is just as good.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like