Use TMUX in NSCC aspire2a
1. To Check the TMUX Version
- tmux -V
2. To Enter the TMUX Session
- tmux
3. Some Basic Usage for TMUX Use
3.1 create a new session:
- tmux new -s [session-name]
3.2 exit the current session to the terminal:
ctrl+b d
3.3 check the TMUX session list:
- tmux ls
3.4 to check TMUX session list while in one session window:
ctrl+b s
3.5 enter a session:
- tmux a -t [session-name]
3.6 destroy a session:
- tmux kill-session -t [session-name]
3.7 rename a session:
- tmux rename -t [old session-name] [new session-name]
4. About TMUX Windows Usage
A TMUX session can have multiple Windows, and each window can be divided into multiple panes. The smallest unit we work in is actually the pane. By default, in a window, there is only one large pane that occupies the entire window area. We work in this area.
4.1 create a new pane:
ctrl+b c
4.2 switch windows:
ctrl+b p
: switch to the previous one window;ctrl+b n
: switch to the next one window;ctrl+b [index]
: switch to the corresponding [index] window;ctrl+b w
: list all windows of this session;-
ctrl+b l
: switch between the contiguous windows;
4.3 ctrl+b &
: to kill a window bash
5. About TMUX Panes Usage
ctrl+b %
: split screen panes of vertical type;ctrl+b "
: split screen panes of level type;
ctrl+b o
: switch panes under the current window in turn;ctrl+b <UP>|<Down>|<Left>|<Right>
: switch to a pane by selecting the arrow direction;ctrl+b <Space>
: rearrange the layout of all panes under the current window, changing styles each time you enter this command;ctrl+b z
: maximize the current pane, and press again to resume;
6. ctrl+b x
: delete the pane currently in use.
MY NSCC USE STEPS:
-
now TMUX first
(this means we create a ‘TMUX session’ first, by:tmux new -s [session_name]
. )(we use tmux because we want to prevent our running programs from being affected by a server remote connection drop & reconnection)
-
qsub -I -l select=1:ncpus=5:mem=50gb:ngpus=1,walltime=36:00:00 -q normal -P personal-lihanzuo -N Alpaca_ATTN
-
module load miniforge3
-
conda activate [my_env]
-
nohup bash [my_python.sh] > log/output_[my_python_name].log 2>&1 &
(If you don’t want to log to the logging_file, please use:nohup bash [my_python.sh] > /dev/null 2>&1 &
)