tmux拆分终端_如何在Linux中拆分,创建和关闭Tmux屏幕?

Tmux是一款强大的终端复用器,能创建多屏、拆分屏幕并支持ssh会话恢复。通过CTRL+B快捷键可以创建新窗口、水平或垂直拆分屏幕,使用p和n键在窗口间切换,及k键关闭当前窗格。了解并掌握tmux能提升Linux系统管理员的工作效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

tmux拆分终端

tmux拆分终端

Tmux is great tool which saves system administrators from a lot of unnecessary workloads. Tmux is creating multiple screens, split current screen and maybe the best part even ssh is closed it resumes to work and after reconnect we can resume from where we were.

Tmux是一个很棒的工具,可以节省许多不必要的系统管理员的工作量。 Tmux正在创建多个屏幕,拆分当前屏幕,也许最好的部分甚至在ssh关闭时也可以恢复工作,重新连接后,我们可以从原来的位置恢复。

打开Tmux (Open Tmux)

We will start tmux terminal emulator simply providing it to bash. We will see a screen like below. We can see that there is a bar below the screen which provides some information like the window list, active window, hostname, time and date.

我们将启动tmux终端仿真器,仅将其提供给bash。 我们将看到如下屏幕。 我们可以看到屏幕下方有一个栏,提供一些信息,例如窗口列表,活动窗口,主机名,时间和日期。

Open Tmux
Open Tmux
打开Tmux

控制快捷方式 (Control Shortcut)

During the usage of the tmux terminal, we will use a control keyboard shortcut in order to create new windows, split them. This is CTRL+B .

在使用tmux终端的过程中,我们将使用控制键盘快捷键来创建新窗口,并将其拆分。 这是CTRL + B。

CTRL+B

水平拆分Tmux屏幕 (Split Tmux Screen Horizontally)

We will split tmux screen horizontally and create new work windows. We will use CTRL+B and after % . As we know CTRL+B is default function tool

我们将水平分割tmux屏幕并创建新的工作窗口。 我们将在之后使用CTRL + B。 众所周知, CTRL + B是默认功能工具

CTRL+B %
Split Tmux Screen Horizontally
Split Tmux Screen Horizontally
水平拆分Tmux屏幕

垂直拆分Tmux屏幕(Split Tmux Screen Vertically)

Similar to the previous example but the split will occur vertically. The cursor will move to the newly created tmux window.

与前面的示例类似,但拆分将垂直发生。 光标将移至新创建的tmux窗口。

CTRL+B "
Split Tmux Screen Vertically
Split Tmux Screen Vertically
垂直拆分Tmux屏幕

创建新的Tmux窗格(Create New Tmux Pane)

We will create a new pane next to the current pane. We can see below in the status bar there is 3 panes named with bash and numbered as 1, 2 and 3.

我们将在当前窗格旁边创建一个新窗格。 我们可以在状态栏中看到下面的三个窗格,分别以bash命名,分别编号为1、2和3。

CTRL+B c
Create New Tmux Window
Create New Tmux Window
创建新的Tmux窗口

导航到上一个窗口(Navigate To The Previous Window)

We can navigate with and keys

我们可以用pn键导航

CTRL+B p     will naviagte to previous windows
CTRL+B n     will navigate to next window

杀死窗格 (Kill Pane)

To kill a tmux pane CTRL+B x key combination is used. We will be asked the question “kill-pane 0”. We have to answer with y which means yes to kill currently active pane.

要杀死tmux窗格,请使用CTRL+B x组合键。 我们将被问到“ kill-pane 0”问题。 我们必须用y回答,这意味着要杀死当前活动的窗格。

Kill Pane
Kill Pane
杀死窗格
LEARN MORE  What Is Shebang Linux or Bash Term?
了解更多Shebang Linux或Bash术语是什么?

翻译自: https://www.poftut.com/split-create-close-tmux-screen-linux/

tmux拆分终端

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值