On Fri, Oct 1, 2021 at 10:19 AM Michael Klemm <michael@xxxxxxxxxxx> wrote: > > > if pgrep "tmux" > /dev/null ; then echo "Running" ; else echo "Stopped" ; > > fi > > On multi-user machine with several tmux instances running for > different users, pgrep tmux will also match those. Just make it: pgrep -u $USER tmux