在本文中,我们将了解Ubuntu 16.04上的Byobu,Byobu是一种终端多路复用器,易于使用,Byobu用于在窗口中具有多个窗口,控制台和拆分窗格,并且还将在其上显示状态标记和通知。终点站。
要完成本教程,我们需要安装Ubuntu 16.04和具有sudo权限的Linux用户。
作为Ubuntu 16.04的默认功能,已安装Byobu。但是,作为一种做法,我们将检查安装和版本,如果没有,我们将安装Byobu。
要检查Byobu是否已安装并查找版本,我们将使用以下命令
$ byobu --version byobu version 5.106 tmux 2.1
如果我们看不到当前版本或显示未找到命令错误–
$ byobu –version -bash: /usr/bin/byobu: No such file or directory
由于我们的计算机上未安装Byobu,因此要安装Byobu,我们需要运行以下命令-
$ sudo apt-get install byobu. Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'byobu-extras' for regex 'byobu.' Note, selecting 'byobu' instead of 'byobu-extras' Suggested packages: ccze gnome-terminal po-debconf ttf-ubuntu-font-family wireless-tools The following NEW packages will be installed: byobu 0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded. Need to get 105 kB of archives. After this operation, 654 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 byobu all 5.106-0ubuntu1 [105 kB] Fetched 105 kB in 1s (83.6 kB/s) Preconfiguring packages ... Selecting previously unselected package byobu. (Reading database ... 89994 files and directories currently installed.) Preparing to unpack .../byobu_5.106-0ubuntu1_all.deb ... Unpacking byobu (5.106-0ubuntu1) ... Setting up byobu (5.106-0ubuntu1) ... Now the Byobu is installed on the Ubuntu
默认情况下,安装后默认禁用Byobu,我们需要启用Byobu,并且有两种方法可以启用Byobu。一种是我们可以在需要时启动Byobu,也可以在登录或启动时启动Byobu。
要启动Bybou,我们只需自动使用以下命令,环境就会发生变化。
$ byobu
如果要启动byobu进入我们的登录配置文件,我们需要使用以下命令启用
$ byobu–enable
每次登录文本时,Byobu窗口管理器都会自动启动。
要稍后禁用此行为,只需运行:
$ byobu-disable
而且,如果我们要停止使用byobu,只需使用byobu-disable命令即可停止使用Byobu。
默认情况下,Byobu将使用tmux作为后端多路复用器,如果我们想将多路复用器更改为屏幕,我们可以使用以下命令–
$ byobu-select-backend Select the byobu backend:
多路复用器
屏幕
默认情况下,tmux是启用的,如果我们要更改多路复用器,我们可以选择屏幕
Byobu具有一个很好的功能,包含在彩色提示中,还包括最后执行的命令的返回代码。我们可以使用以下命令启用此功能–
$ byobu-enable-prompt . ~/.bashrc root@ubuntu-16:~# . ~/.bashrc
请参见下图,了解外壳的变化
当我们将Byobu配置为可以使用时。
由于Byobu使用的是F1到F12的默认键盘,因此默认键盘功能键。
Byobu具有许多功能,例如会话,窗格和窗口。
我们开始会话,以便我们可以拥有自己的窗口大小,并可以连接到具有不同屏幕大小的多个设备。我们可以使用Ctrl + Shift + F2开始新的会话,也可以使用Alt + UP和Alt + Down在打开的会话中前进和后退。
Ctrl+ D -> to exit from Byobu and close all the session we connected. F6 - > Will logout the current session and log you out of the SSH connection. Shift+F6 - > This will be used to detach the session, but the SSH connection will remain connected.
Byobu具有在单个会话中的窗口之间切换的能力,这将使我们能够通过单个连接轻松地执行多任务。
F2->将用于打开带有新命令提示符的新窗口,并可用于执行多个任务。
F3和F4用于分别向上和向下滚动窗口。
F8->向当前窗口添加名称。Ctrl + Shift +
F3或F4->分别在列表中向左或向右移动当前窗口。
F7->回滚历史记录。
Byobu还提供了在垂直和水平方向上将窗口拆分为多个窗格的功能。
Shift+F2 -> To split the current windows into horizontal splits. Ctrl+F2 - > To split the panes into vertical. Shift+F11 - > To Zoom the windows and back again. Alt+F11 -> To split a pane in a new window.
我们必须按F9键才能启用状态通知。当我们按F9键时,将显示Byobu配置菜单,我们需要选择切换状态通知,然后按Enter键,我们可以在屏幕上看到可用选项的列表,我们可以通过选择选项来启用它们。
选择可用的选项后,然后选择“应用”并退出菜单,按F5刷新状态栏,因为通知对于查看有关系统的信息很有用。
以下是Byobu中状态通知可用的一些选项
arch -> shows notification in the system architecture. battery -> shows notification for the current battery level for laptops. date -> shows notification of the current system date. disk -> shows the notification for current disk space usage. hostname -> shows the notification for a current system hostname. ip_address -> notification for shows the current system IP address. load_average -> shows the notification for current system load average. memory -> shows the notification for current memory usage. network -> shows the notification for current network usage, sending and receiving. reboot_required -> shows notification for an indicator when a system reboot is required. release -> shows the notification for current distribution version (e.g. 14.04). time -> shows the notification for current system time. updates_available -> shows notification for an indicator when there are updates available. uptime -> shows the notification for current system uptime. whoami -> shows the notification for currently logged in user.
在上面的文章中,我们可以看到各种各样的功能,并且涵盖了Byobu可用的一些功能,我们可以使用适合您环境的这些功能,并轻松快速地完成工作。