Skip to content

Instantly share code, notes, and snippets.

@jjrh
Created July 12, 2016 16:24
Show Gist options
  • Save jjrh/29f22263fe32e80d98e892f553887cee to your computer and use it in GitHub Desktop.
Save jjrh/29f22263fe32e80d98e892f553887cee to your computer and use it in GitHub Desktop.
creates new tmux session with name (work) if it exists attach to it, if not create it.
#!/bin/bash
tmux list-sessions | grep work
if [ $? -ne 0 ]; then
tmux new-session -s work
else
tmux attach -twork -d
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment