Skip to content

Commit

Permalink
Add a post about 'tmux' command
Browse files Browse the repository at this point in the history
  • Loading branch information
dandyrilla committed Feb 20, 2024
1 parent 6d4ee8e commit 7bd4275
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions _posts/2022-04-15-tmux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
layout: post
title: "tmux"
description: "tmux"
tags: [tmux]
comments: true
share: true
---

## tmux

리눅스의 screen 과 비슷한 소프트웨어로, 여러 터미널 창을 함께 사용하고자 할 때 유용한 도구이다. 리눅스
원격 연결이 꺼져도 서버가 종료되지 않는 이상 tmux 를 통해 띄워놓은 프로세스는 계속 유지되기 때문에 해당
세션 안에서 돌려놓은 프로그램들은 종료되지 않고 계속 실행시킬 수 있다.

## tmux 구성 요소

- session: tmux 명령을 쳤을 때 생성되는 요소. 여러 window 들을 가질 수 있다.
- window: 하나의 프롬프트를 가지는 터미널 화면, session 내에서 마치 탭처럼 사용 가능하다.
- pane: 하나의 윈도우 내에서의 화면 분할을 가능케 하는 요소이다.

## 명령어 및 단축키

Session 관련 명령어 및 단축키

```
# 새로운 세션 생성하기
tmux
# 새로운 세션의 이름을 지정하여 생성하기
tmux new -s {session_name}
# 새로운 세션과 윈도우의 이름을 같이 지정하여 생성하기
tmux new -s {session_name} -n {window_name}
# (세션 내에서) 해당 세션 종료
exit
# 세션 목록 보기
tmux ls
# 세션 다시 불러오기
tmux attach -t {session_number}
# 세션 중단하기
(ctrl + b), d
# 스크롤하기
(ctrl + b + [)
# 특정 세션 강제 종료
tmux kill-session -t session_number
```

Window 관련 명령어 및 단축키

```
# 새 윈도우 생성
(ctrl + b), c
# 윈도우 이동
(ctrl + b), {window_number}
```

Pane 관련 명령어 및 단축키

```
# 틀 나누기
(ctrl + b), % # 좌우로 나누기
(ctrl + b), " # 위아래로 나누기
# 틀끼리 이동하기
(ctrl + b) 방향키
(ctrl + b) q
(ctrl + b) o #순서대로 이동
# 틀 삭제
(ctrl + d)
# 틀 사이즈 조정
(ctrl + b): resize_pane -L 10 #L,R,U,D 입력하면 상하좌우로 조절됨
(ctrl + b), (alt + 방향키)
```

기타 단축키

```
# 단축키 목록
(ctrl + b) ?
```

0 comments on commit 7bd4275

Please sign in to comment.