Here's the line from my .bashrc
Code:
# don't automatically attach a tmux session if we're
# in a TTY, since I usually like to run startx from
# the command-line, and you can't do that in tmux
if [ ! $( tty | grep "/dev/tty[1-9]" ) ] && \
[[ $- = *i* ]] && \
[ ! $( tmux attach-session -t 0 2>/dev/null) ]; then
tmux 2>/dev/null
fi
Here are some other tips, some of which are pretty basic, but I didn't know about them when I first started.
* If you use vim, then you can enable vi line editor in bash with "set -o vi".
* In man pages, you can search through them by hitting the slash key, entering a regular expressions,
and hitting enter. You can use n and N to search forward or backward through the results of the search.
* If you have a command with a lot of output, just type !! | less. !! just expands to the previously
executed command, and | less just pipes the output of it into less, a pager.
You can search through the output the same way you can when viewing a man page (IIRC, this is because man actually uses less).
* Heredocs. There are lots of tutorials online on how to use them.
* Sometimes if you accidentally display binary output on the terminal, it'll jumble up all the text
and cause the terminal to act weird. You can fix it by using the "reset" command.