How to kill all tmux sessions (or at least multiple sessions) from the (Ubuntu) CLI?
When I do ps aux | grep tmux
I see 3 processes:
UU 2970 0.0 0.0 19556 1228 pts/0 S+ 02:48 0:00 tmux
UU 3445 0.0 0.0 12944 988 pts/5 S+ 03:31 0:00 grep --color=auto tmux
UU 27557 0.0 0.2 29788 4840 ? Ss Jan04 0:02 tmux
How could I kill all of these at once (or at least some of them, selectivity) ?
ps aux | grep tmux
aftertmux kill-server
still shows a tmux process... Same goes withpkill -f tmux
as in my answer. Can you explain this? Thanks, – Jan 05 '17 at 06:20grep tmux
process (which is included in the ps output of your original question)? – steeldriver Jan 05 '17 at 13:45ps aux | grep blablablawhichdoesntexist
it will always show at least one line, corresponding to thegrep blablablawhichdoesntexist
command. – dgonzalez Jan 05 '17 at 14:14-t
flag, cos it shows error without-t
flag set for killing a particular session.Usage: kill-session [-a] [-t target-session]
– 1rq3fea324wre Nov 01 '17 at 03:03tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill
– Foad Feb 01 '18 at 14:35