目录

目录

Terminal

系列 - How-to-Term
目录

~/.bashrc 中添加以下配置,

bash

## for history
export HISTTIMEFORMAT="%d/%m/%y %T "
shopt -s histappend
export PROMPT_COMMAND="history -a; history -n"
## for tmux
alias tn='tmux new -s'
alias tl='tmux ls'
alias td='tmux detach'
alias ta='tmux attach -t'
alias tk='tmux kill-session -t'

然后就可以直接使用,

bash

tnew 新的终端会话名
ta 终端会话名

直接关闭终端也会保持在后台运行,通常使用快捷键,注意不要使用 Ctrl C,否则会直接退出!!!