Install tmux for macos

brew install tmux

Install tmux for ubuntu

sudo apt-get install tmux -y

Config file in tmux

Config file is located at
~/.tmux.conf

Leader key in tmux

By default, leader key is Ctrl+b (Press Ctrl and b)
It will activate more tmux function

Install plugin manager for tmux

Install plugin for tmux

+ Add plugin in config file
+ update source file with
tmux source ~/.tmux.conf
+ Run install
Ctrl+b I (capital I)
Or use this command

tmux mode and how to access these mode

Copy mode : Ctrl+b [

Create a new session with tmux

tmux new -s name_of_session

Access session with tmux

tmux a -t name_of_session

List all session with tmux

tmux ls
or use those command below to last and choose another session
Ctrl+b w (list all windows)
or
Ctrl+b s (list all session)

Create / delete a windows with tmux

To create a new window
Ctrl+b c

To delete a window
Ctrl+b &

To switch between 2 windows
Ctrl+b l

Create / delete a pane with tmux

Use this command to create a new pane
Ctrl+b % : create a new vertical pane
Ctrl+b ” : create a new horizontal pane

To delete a pane:
Ctrl+b x

To move between pane
Ctrl+b arrow-key (up/down/left/right)

Resize pane with tmux

Try those command
tmux resize-pane -R
tmux resize-pane -L
tmux resize-pane -U
tmux resize-pane -D

Copy and paste in tmux

Use the plugin
set -g @plugin ‘tmux-plugins/tmux-yank’

Or use the following method
Access Copy mode : Ctrl+b [
Use arrow key to go to the position where you want to start copying
Use Ctrl+Space to start copying
Use Ctrl+c or y to copy / Or use Alt+w or Ctrl+w to copy to tmux buffer
Use Ctrl+] to paste

More reference for a better understanding of tmux

https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/

https://www.rockyourcode.com/copy-and-paste-in-tmux/

Bài viết khác

Bun ORM

1. Bun ORM là gì? Bun là một thư viện ORM và SQL query builder dành cho Go, được thiết kế để làm việc với các cơ sở dữ liệu quan hệ như PostgreSQL, MySQL, SQLite và một số hệ quản trị khác thông qua driver tương ứng. Bun giúp developer ánh xạ dữ liệu […]

Eloquent ORM

Eloquent ORM là gì? Hướng dẫn sử dụng Eloquent trong Laravel 1. Eloquent ORM là gì? Eloquent ORM là hệ thống Object-Relational Mapping (ORM) được tích hợp trong Laravel, một framework phát triển ứng dụng Web bằng PHP. Eloquent cho phép lập trình viên tương tác với cơ sở dữ liệu thông qua các class […]

GORM

1. GORM là gì? GORM (Go ORM) là thư viện Object-Relational Mapping dành cho Go, giúp làm việc với cơ sở dữ liệu quan hệ thông qua các struct và API của Go thay vì phải viết SQL cho mọi thao tác. Trong một ứng dụng backend, dữ liệu thường được lưu trong PostgreSQL, MySQL […]

CAP theorem

1. CAP Theorem là gì? CAP Theorem là một định lý nền tảng trong Distributed Systems, giải thích giới hạn của việc đồng thời đảm bảo ba thuộc tính: Consistency (C), Availability (A) và Partition Tolerance (P) trong một hệ thống dữ liệu phân tán. Định lý bắt nguồn từ nhận định của Eric Brewer […]

CAP Theorem

CAP Theorem là gì? Tìm hiểu Consistency, Availability và Partition Tolerance 1. CAP Theorem là gì? CAP Theorem (định lý CAP) là một nguyên lý quan trọng trong thiết kế hệ thống phân tán, mô tả sự đánh đổi giữa tính nhất quán (Consistency) và tính sẵn sàng (Availability) khi xảy ra phân vùng mạng […]

Saga Pattern

Saga Pattern là gì? Quản lý Transaction trong kiến trúc Microservices 1. Saga Pattern là gì? Saga Pattern là một mẫu thiết kế được sử dụng để quản lý các nghiệp vụ phân tán gồm nhiều bước xử lý, trong đó mỗi bước có thể thực hiện một local transaction tại một service hoặc Database […]