Merge pull request #10 from LCTT/master

Update from LCTT
This commit is contained in:
chen ni 2019-06-27 09:48:44 +08:00 committed by GitHub
commit b28695f5fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 796 additions and 361 deletions

View File

@ -1,28 +1,30 @@
[#]: collector: (lujun9972)
[#]: translator: (chen-ni)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11021-1.html)
[#]: subject: (A short primer on assemblers, compilers, and interpreters)
[#]: via: (https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters)
[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny)
浅谈汇编器编译器和解释器
浅谈汇编器编译器和解释器
======
简单介绍一下编程方式的历史演变
![keyboard with connected dots][1]
在计算机诞生不久的早期年代,硬件非常昂贵,而程序员比较廉价。这些廉价程序员甚至都没有“程序员”这个头衔,并且常常是由数学家或者电气工程师来充当这个角色的。早期的计算机被用来在短时间内解决复杂的数学问题,所以数学家天然就适合“编程”工作。
> 简单介绍一下编程方式的历史演变。
![](https://img.linux.net.cn/data/attachment/album/201906/26/181309vdouxdfktr344rm4.jpg)
在计算机诞生不久的早期年代,硬件非常昂贵,而程序员比较廉价。这些廉价程序员甚至都没有“程序员”这个头衔,并且常常是由数学家或者电气工程师来充当这个角色的。早期的计算机被用来快速解决复杂的数学问题,所以数学家天然就适合“编程”工作。
### 什么是程序?
首先来看一点背景知识。计算机自己是做不了任何事情的,它们的任何行为都需要程序来引导。你可以把程序看成是非常精确的菜谱,这种菜谱读取一个输入,然后生成对应的输出。菜谱里的各个步骤由操作数据的指令构成。听上去有点儿复杂,不过你或许知道下面这个语句是什么意思:
```
`1 + 2 = 3`
1 + 2 = 3
```
其中的加号是“指令”,而数字 1 和 2 是数据。数学上的等号意味着等式两边的部分是“等价”的,不过在大部分编程语言中等号(或者它的变形)都是“赋值”的意思。如果计算机执行上面这个语句它会把这个加法的结果也就是“3”储存在内存中的某个地方。
其中的加号是“指令”,而数字 1 和 2 是数据。数学上的等号意味着等式两边的部分是“等价”的,不过在大部分编程语言中对变量使用等号是“赋值”的意思。如果计算机执行上面这个语句它会把这个加法的结果也就是“3”储存在内存中的某个地方。
计算机知道如何使用数字进行数学运算,以及如何在内存结构中移动数据。在这里就不对内存进行展开了,你只需要知道内存一般分为两大类:“速度快/空间小”和“速度慢/空间大”。CPU 寄存器的读写速度非常快但是空间非常小相当于一个速记便签。主存储器通常有很大的空间但是读写速度就比寄存器差远了。在程序运行的时候CPU 不断将它所需要用到的数据从主存储器挪动到寄存器,然后再把结果放回到主存储器。
@ -32,9 +34,9 @@
![Programmers operate the ENIAC computer][2]
_程序员[Betty Jean Jennings][3] (左) 和 [Fran Bilas][4] (右) 在操作 [ENIAC][5] 的主控制面板._
*程序员[Betty Jean Jennings][3] (左) 和 [Fran Bilas][4] (右) 在操作 [ENIAC][5] 的主控制面板*
后来有一名 [电气工程师][6] 认为自己的时间很宝贵,就写了一个能够把人们可以读懂的“菜谱”一样的程序转换成计算机可以读懂的版本的程序。这就是最初的“汇编器”,在当时引起了不小的争议。这些昂贵机器的主人不希望把计算资源浪费在人们已经做的任务上(虽然又慢又容易出错)。不过随着时间的推移,人们逐渐发现使用汇编器在速度和准确性上都胜于人工编写机器语言,并且计算机完成的“实际工作量”增加了。
后来有一名 [电气工程师][6] 认为自己的时间很宝贵,就写了一个程序,能够把人们可以读懂的“菜谱”一样的输入转换成计算机可以读懂的版本。这就是最初的“汇编器”,在当时引起了不小的争议。这些昂贵机器的主人不希望把计算资源浪费在人们已经做的任务上(虽然又慢又容易出错)。不过随着时间的推移,人们逐渐发现使用汇编器在速度和准确性上都胜于人工编写机器语言,并且计算机完成的“实际工作量”增加了。
尽管汇编器相比在机器面板上切换比特的状态已经是很大的进步了,这种编程方式仍然非常专业。上面加法的例子在汇编语言中看起来差不多是这样的:
@ -46,15 +48,15 @@ _程序员[Betty Jean Jennings][3] (左) 和 [Fran Bilas][4] (右) 在操作 [EN
05 STO R2, R0
```
每一行都是一个计算机指令,前面是一个指令的简写,后面是指令所操作的数据。这个小小的程序会将数值 1 “移动”到寄存器 R0然后把 2 移动到寄存器 R1。03 行把 R0 和 R1 两个寄存器里的数值相加,然后将结果储存在 R2 寄存器里。最后04 行和 05 行决定结果应该被放在主存储器里的什么位置(在这里是地址 64。管理内存中存储数据的位置是编程过程中最耗时也最容易出错的部分之一。
每一行都是一个计算机指令,前面是一个指令的简写,后面是指令所操作的数据。这个小小的程序首先会将数值 1 “移动”到寄存器 R0然后把 2 移动到寄存器 R1。03 行把 R0 和 R1 两个寄存器里的数值相加,然后将结果储存在 R2 寄存器里。最后04 行和 05 行决定结果应该被放在主存储器里的什么位置(在这里是地址 64。管理内存中存储数据的位置是编程过程中最耗时也最容易出错的部分之一。
### 编译器
汇编器已经比手写计算机指令要好太多了,不过早期的程序员还是渴望能够按照他们所习惯的方式,像书写数学公式一样地去写程序。这种需求驱动了更高级别编译语言的发展,其中有一些已经成为历史,另一些如今还在使用。比如[ALGO][7] 就已经成为历史了,但是像 [Fortran][8] 和 [C][9] 这样的语言仍然在不断解决实际问题。
汇编器已经比手写计算机指令要好太多了,不过早期的程序员还是渴望能够按照他们所习惯的方式,像书写数学公式一样地去写程序。这种需求推动了高级编译语言的发展,其中有一些已经成为历史,另一些如今还在使用。比如 [ALGO][7] 就已经成为历史了,但是像 [Fortran][8] 和 [C][9] 这样的语言仍然在不断解决实际问题。
![Genealogy tree of ALGO and Fortran][10]
ALGO 和 Fortran 编程语言的谱系树
*ALGO 和 Fortran 编程语言的谱系树*
这些“高级”语言使得程序员可以用更简单的方式编写程序。在 C 语言中,我们的加法程序就变成了这样:
@ -63,40 +65,41 @@ int x;
x = 1 + 2;
```
第一个语句描述了该程序将要使用的一块内存。在这个例子中,这块内存应该占一个整数的大小,名字是 **x**。第二个语句是加法,虽然是倒着写的。一个 C 语言的程序员会说这是 "X 被赋值为 1 加 2 的结果"。需要注意的是,程序员并不需要决定在内存的什么位置储存 **x**,这个任务交给编译器了。
第一个语句描述了该程序将要使用的一块内存。在这个例子中,这块内存应该占一个整数的大小,名字是 `x`。第二个语句是加法,虽然是倒着写的。一个 C 语言的程序员会说这是 “X 被赋值为 1 加 2 的结果”。需要注意的是,程序员并不需要决定在内存的什么位置储存 `x`,这个任务交给编译器了。
这种被称为“编译器”的新程序可以把用高级语言写的程序转换成汇编语言,再使用汇编器把汇编语言转换成机器可读的程序。这种程序组合常常被称为“工具链”,因为一个程序的输出就直接成为另一个程序的输入。
这种被称为“编译器”的新程序可以把用高级语言写的程序转换成汇编语言,再使用汇编器把汇编语言转换成机器可读的程序。这种程序组合常常被称为“工具链”,因为一个程序的输出就直接成为另一个程序的输入。
编译语言相比汇编语言的优势体现在从一台计算机迁移到不同型号或者品牌的另一台计算机上的时候。在计算机的早期岁月里,包括 IBMDigital Equipment Corporation德州仪器UNIVAC 以及惠普在内的很多公司都在尝试不同类型的计算机硬件。这些计算机除了都需要连接电源之外就没有太多共同点了。它们在内存和 CPU 架构上的差异相当大,当时经常需要人们花费数年来将一台计算机的程序翻译成另一台计算机的程序。
编译语言相比汇编语言的优势体现在从一台计算机迁移到不同型号或者品牌的另一台计算机上的时候。在计算机的早期岁月里,包括 IBM、DEC、德州仪器、UNIVAC 以及惠普在内的很多公司都在制造除了大量不同类型的计算机硬件。这些计算机除了都需要连接电源之外就没有太多共同点了。它们在内存和 CPU 架构上的差异相当大,当时经常需要人们花费数年来将一台计算机的程序翻译成另一台计算机的程序。
有了高级语言,我们只需要把编译器工具链迁移到新的平台就行了。只要有可用的编译器,高级语言写的程序最多只需要经过小幅修改就可以在新的计算机上被重新编译。高级语言的编译是一个真正的革命性成果。
![IBM PC XT][11]
1983 发布的 IBM PC XT 是硬件价格下降的早期例子。
程序员们的生活得到了很好的改善。相比之下,通过高级语言表达他们想要解决的问题让事情变得轻松很多。由于半导体技术的进步以及集成芯片的发明,计算机硬件的价格急剧下降。计算机的速度越来越快,能力也越来越强,并且还便宜了很多。从某个时点往后(也许是 80 年代末期吧),事情发生了转变,程序员变得比他们所使用的硬件更值钱了。
*1983 发布的 IBM PC XT 是硬件价格下降的早期例子。*
程序员们的生活得到了很好的改善。相比之下,通过高级语言表达他们想要解决的问题让事情变得轻松很多。由于半导体技术的进步以及集成芯片的发明,计算机硬件的价格急剧下降。计算机的速度越来越快,能力也越来越强,并且还便宜了很多。从某个时间点往后(也许是 80 年代末期吧),事情发生了反转,程序员变得比他们所使用的硬件更值钱了。
### 解释器
随着时间的推移,一种新的编程方式兴起了。一种被称为“解释器”的特殊程序可以将程序直接转换成可以立即执行的计算机指令。和编译器差不多,解释器读取程序并将它转换成一个中间形态。但和编译器不同的是,解释器直接执行程序的这个中间形态。解释型语言在每一次执行的时候都要经历这个过程;而编译程序只需要编译一次,之后计算机每次只需要执行编译好的机器指令就可以了。
随着时间的推移,一种新的编程方式兴起了。一种被称为“解释器”的特殊程序可以直接读取一个程序将其转换成计算机指令以立即执行。和编译器差不多,解释器读取程序并将它转换成一个中间形态。但和编译器不同的是,解释器直接执行程序的这个中间形态。解释型语言在每一次执行的时候都要经历这个过程;而编译程序只需要编译一次,之后计算机每次只需要执行编译好的机器指令就可以了。
顺便说一句,这个特性就是导致人们感觉解释型程序运行得比较慢的原因。不过现代计算机的性能出奇地强大,以至于大多数人无法区分编译型程序和解释型程序。
解释型程序(有时也被成为“脚本”)甚至更容易被移到不同的硬件平台上。因为脚本并不包含任何机器特有的指令,同一个版本的程序可以不经过任何修改就直接在很多不同的计算机上运行。不过当然了,解释器必须得先移到新的机器上才行。
解释型程序(有时也被成为“脚本”)甚至更容易被移到不同的硬件平台上。因为脚本并不包含任何机器特有的指令,同一个版本的程序可以不经过任何修改就直接在很多不同的计算机上运行。不过当然了,解释器必须得先移到新的机器上才行。
一个很流行的解释型语言是 [perl][12]。用 perl 完整地表达我们的加法问题会是这样的:
```
`$x = 1 + 2`
$x = 1 + 2
```
虽然这个程序看起来和 C 语言的版本差不多,运行上也没有太大区别,但却缺少了初始化变量的语句。其实还有一些其它的区别(超出这篇文章的范围了),但你应该已经注意到,我们写计算机程序的方式已经和数学家用纸笔手写数学表达式非常接近了。
### 虚拟机
最新潮的编程方式要数虚拟机(经常简称 VM了。虚拟机分为两大类系统虚拟机和进程虚拟机。这两种虚拟机都提供一种对“真实的”计算硬件的不同级别的抽象不过们的作用域不同。系统虚拟机是一个提供物理硬件的替代的软件,而进程虚拟机则被设计用来以一种“系统独立”的方式执行程序。所以在这个例子里,进程虚拟机(往后我所说的虚拟机都是指这个类型)的作用域和解释器的比较类似,因为也是先将程序编译成一个中间形态,然后虚拟机再执行这个中间形态。
最新潮的编程方式要数虚拟机(经常简称 VM了。虚拟机分为两大类系统虚拟机和进程虚拟机。这两种虚拟机都提供一种对“真实的”计算硬件的不同级别的抽象不过们的作用域不同。系统虚拟机是一个提供物理硬件的替代的软件,而进程虚拟机则被设计用来以一种“系统独立”的方式执行程序。所以在这个例子里,进程虚拟机(往后我所说的虚拟机都是指这个类型)的作用域和解释器的比较类似,因为也是先将程序编译成一个中间形态,然后虚拟机再执行这个中间形态。
虚拟机和解释器的主要区别在于,虚拟机创造了一个虚拟的 CPU以及一套虚拟的指令集。有了这层抽象我们就可以编写前端工具来把不同语言的程序编译成虚拟机可以接受的程序了。也许最流行也最知名的虚拟机就是 Java 虚拟机JVM了。JVM 最初在 1990 年代只支持 Java 语言,但是如今却可以运行 [许多][13] 流行的编程语言,包括 ScalaJythonJRubyClojure以及 Kotlin 等等。还有其它一些不太常见的例子,在这里就不说了。我也是最近才知道,我最喜欢的语言 Python 并不是一个解释型语言,而是一个 [运行在虚拟机上的语言][15]!
虚拟机和解释器的主要区别在于,虚拟机创造了一个虚拟的 CPU以及一套虚拟的指令集。有了这层抽象我们就可以编写前端工具来把不同语言的程序编译成虚拟机可以接受的程序了。也许最流行也最知名的虚拟机就是 Java 虚拟机JVM了。JVM 最初在 1990 年代只支持 Java 语言,但是如今却可以运行 [许多][13] 流行的编程语言,包括 Scala、Jython、JRuby、Clojure以及 Kotlin 等等。还有其它一些不太常见的例子,在这里就不说了。我也是最近才知道,我最喜欢的语言 Python 并不是一个解释型语言,而是一个 [运行在虚拟机上的语言][15]
虚拟机仍然在延续这样一个历史趋势:让程序员在使用特定领域的编程语言解决问题的时候,所需要的对特定计算平台的了解变得越来越少了。
@ -104,18 +107,14 @@ x = 1 + 2;
希望你喜欢这篇简单介绍软件背后运行原理的短文。有什么其它话题是你想让我接下来讨论的吗?在评论里告诉我吧。
* * *
_This article was originally published on[PyBites][16] and is reprinted with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters
作者:[Erik O'Shaughnessy][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/chen-ni)
校对:[校对者ID](https://github.com/校对者ID)
译者:[chen-ni](https://github.com/chen-ni)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,15 +1,16 @@
[#]: collector: (lujun9972)
[#]: translator: (Modrisco)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11020-1.html)
[#]: subject: (How to send email from the Linux command line)
[#]: via: (https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
如何用 Linux 命令行发电子邮件
======
Linux 提供了几种命令允许您通过终端发送电子邮件,下面来展示一些有趣的方法。
> Linux 提供了几个可以让你通过终端发送电子邮件的命令,下面来展示一些有趣的方法。
![Molnia/iStock][1]
@ -29,7 +30,7 @@ $ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss
$ mail -s "Reminder:Leaving early" myboss < reason4leaving
```
在以上两种情况中,你都可以通过 -s 来为邮件添加标题。
在以上两种情况中,你都可以通过 `-s` 来为邮件添加标题。
### sendmail
@ -53,13 +54,13 @@ I would just like to say that, in my opinion, longer hair and other flamboyant
affectations of appearance are nothing more ...
```
你也可以发送这样的文件lyric 文件包含标题和正文):
你也可以发送这样的文件(`lyric` 文件包含标题和正文):
```
$ sendmail recip < lyrics
```
`sendmain` 的输出可能会很冗长。如果你感到好奇并希望查看发送系统和接收系统之间的交互,请添加 `-v` verbose选项。
`sendmain` 的输出也可以很冗长。如果你感到好奇并希望查看发送系统和接收系统之间的交互,请添加 `-v` verbose选项。
```
$ sendmail -v recip@emailsite.com < lyrics
@ -67,9 +68,9 @@ $ sendmail -v recip@emailsite.com < lyrics
### mutt
`mutt` 是通过命令行发送邮件的一个很好的工具,在使用前你需要安装它。 `mutt` 的一个很方便的优势就是它允许你在邮件中添加附件。
`mutt` 是通过命令行发送邮件的一个很好的工具,在使用前你需要安装它。`mutt` 的一个很方便的优势就是它允许你在邮件中添加附件。
使用 `mutt` 发送一条快速信息:
使用 `mutt` 发送一条快速信息:
```
$ echo "Please check last night's backups" | mutt -s "backup check" recip
@ -122,16 +123,16 @@ EHLO mysite.org <== introduce yourself
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
MAIL FROM: me@mysite.org <== specify sender
MAIL FROM: me@mysite.org <== 指定发件人
250 2.1.0 shs@mysite.org... Sender ok
RCPT TO: recip <== specify recipient
RCPT TO: recip <== 指定收件人
250 2.1.5 recip... Recipient ok
DATA <== start message
DATA <== 邮件内容开始
354 Enter mail, end with "." on a line by itself
This is a test message. Please deliver it for me.
. <== end message
. <== 内容结束
250 2.0.0 x5CKWDds029287 Message accepted for delivery
quit <== end exchange
quit <== 结束交互
```
### 向多个收件人发送电子邮件
@ -156,7 +157,7 @@ via: https://www.networkworld.com/article/3402027/how-to-send-email-from-the-lin
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[Modrisco](https://github.com/Modrisco)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (wahailin)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,78 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (You Cant Afford Not to Use a Business-Driven SD-WAN)
[#]: via: (https://www.networkworld.com/article/3404618/you-can-t-afford-not-to-use-a-business-driven-sd-wan.html)
[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/)
You Cant Afford Not to Use a Business-Driven SD-WAN
======
![maxkabakov/istock][1]
Digital transformation and cloud initiatives are changing the way IT organizations are thinking about and architecting the wide area network. It is estimated that over 70 percent of applications have already moved to the cloud. Yet, the transformational promise of the cloud is falling short as conventional networks cant keep pace with demands of the cloud. Why? Because todays router-centric and basic [SD-WAN][2] architectures have either hit the wall or cant keep up with traffic pattern shifts, distributed applications and the open security perimeters inherent to the cloud. This blog will explore the limitations of todays WAN approaches, offering a better way forward with a business-first networking model.
### **Traditional Router-centric WAN**
The traditional router-centric model is network-driven, where businesses are forced to conform to the constraints of the network. Enterprises struggle trying to stretch the old router-centric WAN its too cumbersome and complicated and is simply unable to meet the business needs of a cloud-first enterprise. Cloud-first enterprise business requirements include:
* Using the internet to connect users directly to cloud applications
* Delivering new applications to 1000s of sites, across multiple clouds, in 10 percent of the time
* Delivering 10x more bandwidth at the edge, for the same budget
* Protecting the business when the cloud is open, accessible and everything is connected
* Continuously delivering a WOW application performance for every business-critical application
![][3]
### **Basic SD-WAN Solutions**
To address the requirements of cloud-first businesses, a plethora of SD-WAN solutions have emerged in the past few years. Basic SD-WAN solutions are a step in the right direction but fall well short of the goal of a fully automated business-driven network. A basic SD-WAN provides some level of automation and intelligence, but it is unable to continuously and automatically adapt to changing network conditions. A basic SD-WAN solution cant deliver a consistent WOW experience for real-time voice and video applications, especially over broadband. Furthermore, with a basic SD-WAN, IT is unable to deliver a simplified end-to-end secure segmentation across the LAN-WAN-LAN/Data Center to minimize the attack surface.  A basic SD-WAN also wont deliver on the promised savings in operational costs. The graphic below illustrates the short falls of a basic SD-WAN offering. 
![][4]
### **The Time is Now to Shift to a Business-driven SD-WAN**
With a [business-driven SD-WAN][5], the network becomes a business enabler, not a constraint. It acts as a business accelerant with a top-down approach that starts with business intent. Business intent defines how applications should be delivered to end users. Business intent can include performance, priority, security, resiliency, routing, etc. that should be applied to different classes of applications. With a business-driven SD-WAN, network resources are matched automatically based on the business priority and security requirements for every application. The network continuously monitors the performance of applications and transport resources and automatically adapts to any changes to remain in compliance with application QoS and security policies. A business-driven SD-WAN delivers the highest quality of experience for users with consistent, reliable application performance including the highest quality voice and video over broadband. 
The highest quality of experience doesnt stop with users. With [centralized orchestration][6], a business-driven SD-WAN minimizes human error, makes changes easier and enables faster response to business needs. A business-driven SD-WAN goes beyond the automation and templates of basic SD-WAN solutions to power a self-driving wide area network™ that learns and adapts to the changing requirements of the business to ensure the highest levels of end user and application performance. It eliminates the impact of brownouts and blackouts as monitoring and analytics detect changing conditions and trigger immediate adjustments. Built-in monitoring, alarms/alerts and reporting enables faster troubleshooting when issues occur. With a highly available, resilient, business-driven SD-WAN, IT can reclaim their weekends and sleep through the night!  A unified platform is designed as one unifying and orchestrating network functions such as SD-WAN, firewall, segmentation, routing, WAN optimization, application visibility and control based on business requirements. With service chaining, to ecosystem partners (security, cloud and service providers), existing investments can be fully leveraged with rapid deployment, interoperating with full and open APIs.    
![][7]
In this table, a comparison of router-centric, basic SD-WAN and business-driven SD-WAN shows that enterprises get the most value and benefits from shifting to a business-first networking model. 
![Full Harvey Ball: Most; Empty Harvey Ball: Least][8]
Click on the [infographic][9] for a full summary of the WAN edge architecture approaches.
![][10]
With an interactive ROI calculator, you can calculate savings between a business-driven SD-WAN from Silver Peak and a traditional router-centric SD-WAN. Click [here][11] to calculate your savings right now.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3404618/you-can-t-afford-not-to-use-a-business-driven-sd-wan.html
作者:[Rami Rammaha][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Rami-Rammaha/
[b]: https://github.com/lujun9972
[1]: https://images.idgesg.net/images/article/2019/06/istock-1073941846-100800084-large.jpg
[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained
[3]: https://images.idgesg.net/images/article/2019/06/illo_1-100800095-large.jpg
[4]: https://images.idgesg.net/images/article/2019/06/illo_2-100800097-large.jpg
[5]: https://www.silver-peak.com/products/unity-edge-connect
[6]: https://www.silver-peak.com/products/unity-orchestrator
[7]: https://images.idgesg.net/images/article/2019/06/illo_3-100800099-large.jpg
[8]: https://images.idgesg.net/images/article/2019/06/sd-wan-comparison-chart4-100800100-large.jpg
[9]: https://www.silver-peak.com/sites/default/files/infoctr/sd-wan-comparison-diagram-0119.pdf
[10]: https://images.idgesg.net/images/article/2019/06/acomparisonoftodayswanedgeapproaches-100800113-large.jpg
[11]: https://www.silver-peak.com/sd-wan-interactive-roi-calculator

View File

@ -1,121 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (luuming)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (When to be concerned about memory levels on Linux)
[#]: via: (https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
When to be concerned about memory levels on Linux
======
Memory management on Linux systems is complicated. Seeing high usage doesnt necessarily mean theres a problem. There are other things you should also consider.
![Qfamily \(CC BY 2.0\)][1]
Running out of memory on a Linux system is generally _not_ a sign that there's a serious problem. Why? Because a healthy Linux system will cache disk activity in memory, basically gobbling memory that isn't being used, which is a very good thing.
In other words, it doesn't allow memory to go to waste. It uses the spare memory to increase disk access speed, and it does this _without_ taking memory away from running applications. This memory caching, as you might well imagine, is hundreds of times faster than working directly with the hard-disk drives (HDD) and significantly faster than solid-state drives. Full or near full memory normally means that a system is running as efficiently as it can — not that it's running into problems.
**[ Also see:[Must-know Linux Commands][2] ]**
### How caching works
Disk caching simply means that a system is taking advantage of unused resources (free memory) to speed up disk reads and writes. Applications don't lose anything and most of the time can acquire more memory whenever they need it. In addition, disk caching does not cause applications to resort to using swap. Instead, memory used for disk caching is always returned immediately when needed and disk content updated.
### Major and minor page faults
Linux systems allocate memory to processes by breaking physical memory into chunks called "pages" and then mapping those pages into process virtual memory. Pages that appear to no longer be used may be removed from memory — even if the related process is still running. When a process needs a page that is no longer mapped or no longer in memory, a fault is generated. So, "fault" does not mean "error" but instead means "unavailable," and faults play an important role in memory management.
A minor fault means the page is in memory but not allocated to the requesting process or not marked as present in the memory management unit. A major fault means the page in no longer in memory.
If you'd like to get a feel for how often minor and major page faults occur, try a **ps** command like this one. Note that we're asking for the fields related to page faults and the commands to be listed. Numerous lines were omitted from the output. The MINFL displays the number of minor faults, while MAJFL represents the number of major faults.
```
$ ps -eo min_flt,maj_flt,cmd
MINFL MAJFL CMD
230760 150 /usr/lib/systemd/systemd --switched-root --system --deserialize 18
0 0 [kthreadd]
0 0 [rcu_gp]
0 0 [rcu_par_gp]
0 0 [kworker/0:0H-kblockd]
...
166 20 gpg-agent --homedir /var/lib/fwupd/gnupg --use-standard-socket --daemon
525 1 /usr/libexec/gvfsd-trash --spawner :1.16 /org/gtk/gvfs/exec_spaw/0
4966 4 /usr/libexec/gnome-terminal-server
3617 0 bash
0 0 [kworker/1:0H-kblockd]
927 0 gdm-session-worker [pam/gdm-password]
```
To report on a single process, you might try a command like this:
```
$ ps -o min_flt,maj_flt 1
MINFL MAJFL
230064 150
```
You can also add other fields such as the process owner's UID and GID.
```
$ ps -o min_flt,maj_flt,cmd,args,uid,gid 1
MINFL MAJFL CMD COMMAND UID GID
230064 150 /usr/lib/systemd/systemd -- /usr/lib/systemd/systemd -- 0 0
```
### How full is full?
One way to get a better handle on how memory is being used is with the **free -m** command. The **-m** option reports the numbers in mebibytes (MiBs) instead of bytes.
```
$ free -m
total used free shared buff/cache available
Mem: 3244 3069 35 49 140 667
Swap: 3535 0 3535
```
Note that "free" (unused) memory can be running low while "available" (available for starting new applications) might report a larger number. The distinction between these two fields is well worth paying attention to. Available means that it can be recovered and used when needed, while free means that it's available now.
### When to worry
If performance on a Linux systems appears to be good — applications are responsive, the command line shows no indications of a problem — chances are the system's in good shape. Keep in mind that some application might be slowed down for some reason that doesn't affect the overall system.
An excessive number of hard faults may indeed indicate a problem, but balance this with observed performance.
A good rule of thumb is to worry when available memory is close to zero or when the "swap used" field grows or fluctuates noticeably. Don't worry if the "available" figure is a reasonable percentage of the total memory available as it is in the example from above repeated here:
```
$ free -m
total used free shared buff/cache available
Mem: 3244 3069 35 49 140 667
Swap: 3535 0 3535
```
### Linux performance is complicated
All that aside, memory on a Linux system can fill up and performance can slow down. Just don't take one report on memory usage as an indication that your system's in trouble.
Memory management on Linux systems is complicated because of the measures taken to ensure the best use of system resources. Don't let the initial appearance of full memory trick you into believing that your system is in trouble when it isn't.
**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]**
Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://images.idgesg.net/images/article/2019/05/full-swimming-pool-100796221-large.jpg
[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html
[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua
[4]: https://www.facebook.com/NetworkWorld/
[5]: https://www.linkedin.com/company/network-world

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (heguagnzhi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,192 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Using i3 with multiple monitors)
[#]: via: (https://fedoramagazine.org/using-i3-with-multiple-monitors/)
[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/)
Using i3 with multiple monitors
======
![][1]
Are you using multiple monitors with your Linux workstation? Seeing many things at once might be beneficial. But there are often much more windows in our workflows than physical monitors — and thats a good thing, because seeing too many things at once might be distracting. So being able to switch what we see on individual monitors seems crucial.
Lets talk about i3 — a popular tiling window manager that works great with multiple monitors. And there is one handy feature that many other window managers dont have — the ability to switch workspaces on individual monitors independently.
### Quick introduction to i3
The [Fedora Magazine has already covered i3][2] about three years ago. And it was one of the most popular articles ever published! Even though thats not always the case, i3 is pretty stable and that article is still very accurate today. So — not to repeat ourselves too much — this article only covers the very minimum to get i3 up and running, and youre welcome to go ahead and read it if youre new to i3 and want to learn more about the basics.
To install i3 on your system, run the following command:
```
$ sudo dnf install i3
```
When thats done, log out, and on the log in screen choose i3 as your window manager and log back in again.
When you run i3 for the first time, youll be asked if you wish to proceed with automatic configuration — answer yes here. After that, youll be asked to choose a “mod key”. If youre not sure here, just accept the default which sets you Windows/Super key as the mod key. Youll use this key for mostly all the shortcuts within the window manager.
At this point, you should see a little bar at the bottom and an empty screen. Lets have a look at some of the basic shortcuts.
Open a terminal using:
```
$mod + enter
```
Switch to a second workspace using:
```
$mod + 2
```
Open firefox in two steps, first by:
```
$mod + d
```
… and then by typing “firefox” and pressing enter.
Move it to the first workspace by:
```
$mod + shift + 1
```
… and switch to the first workspace by:
```
$mod + 1
```
At this point, youll see a terminal and a firefox window side by side. To close a window, press:
```
$mod + shift + q
```
There are more shortcuts, but these should give you the minimum to get started with i3.
Ah! And to exit i3 (to log out) press:
```
$mod + shift + e
```
… and then confirm using your mouse at the top-right corner.
### Getting multiple screens to work
Now that we have i3 up and running, lets put all those screens to work!
To do that, well need to use the command line as i3 is very lightweight and doesnt have gui to manage additional screens. But dont worry if that sounds difficult — its actually quite straightforward!
The command well use is called xrandr. If you dont have xrandr on your system, install it by running:
```
$ sudo dnf install xrandr
```
When thats installed, lets just go ahead and run it:
```
$ xrandr
```
The output lists all the available outputs, and also indicated which have a screen attached to them (a monitor connected with a cable) by showing supported resolutions. Good news is that we dont need to really care about the specific resolutions to make the them work.
This specific example shows a primary screen of a laptop (named eDP1), and a second monitor connected to the HDMI-2 output, physically positioned right of the laptop. To turn it on, run the following command:
```
$ xrandr --output HDMI-2 --auto --right-of eDP1
```
And thats it! Your screen is now active.
![Second screen active. The commands shown on this screenshot are slightly different than in the article, as they set a smaller resolution to make the screenshots more readable.][3]
### Managing workspaces on multiple screens
Switching workspaces and creating new ones on multiple screens is very similar to having just one screen. New workspaces get created on the screen thats currently active — the one that has your mouse cursor on it.
So, to switch to a specific workspace (or to create a new one in case it doesnt exist), press:
```
$mod + NUMBER
```
And you can switch workspaces on individual monitors independently!
![Workspace 2 on the left screen, workspace 4 on the right screen.][4]
![Left screen switched to workspace 3, right screen still showing workspace 4.][5]
![Right screen switched to workspace 4, left screen still showing workspace 3.][6]
### Moving workspaces between monitors
The same way we can move windows to different workspaces by the following command:
```
$mod + shift + NUMBER
```
… we can move workspaces to different screens as well. However, there is no default shortcut for this action — so we have to create it first.
To create a custom shortcut, youll need to open the configuration file in a text editor of your choice (this article uses _vim_):
```
$ vim ~/.config/i3/config
```
And add the following lines to the very bottom of the configuration file:
```
# Moving workspaces between screens
bindsym $mod+p move workspace to output right
```
Save, close, and to reload and apply the configuration, press:
```
$mod + shift + r
```
Now youll be able to move your active workspace to the second monitor by:
```
$mod + p
```
![Workspace 2 with Firefox on the left screen][7]
![Workspace 2 with Firefox moved to the second screen][8]
And thats it! Enjoy your new multi-monitor experience, and to learn more about i3, youre welcome to read the previous article about i3 on the Fedora Magazine, or consult the official i3 documentation.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/using-i3-with-multiple-monitors/
作者:[Adam Šamalík][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/asamalik/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/i3-title-816x345.jpg
[2]: https://fedoramagazine.org/getting-started-i3-window-manager/
[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/0-1-1024x384.png
[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-1-1024x384.png
[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-2-1024x384.png
[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-3-1024x384.png
[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-1-1024x384.png
[8]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-2-1024x384.png

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (wahailin)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,268 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (5 tiny Linux distros to try before you die)
[#]: via: (https://opensource.com/article/19/6/linux-distros-to-try)
[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/marcobravo)
5 tiny Linux distros to try before you die
======
Resurrect an ancient machine, boot a broken system, or ensure a safe
public computing session with these tiny Linux distros.
![Hand putting a Linux file folder into a drawer][1]
There are plenty of Linux distributions out there to choose from when you're deciding what to run on a daily basis, yet some are so small that they get little notice. But tiny Linux distributions are powerful innovations: having an entire operating system drive a computer with less than 1GB of storage and half as much RAM is the ultimate software hack.
Tiny distros have many uses, such as:
* Save old and slow computers from the rubbish bin. Reject planned obsolescence and use computers until they fall apart, not just until they start to feel slow.
* Boot broken or corrupted systems from a thumb drive to recover data or repair boot partitions.
* Ensure a safe and private environment when on a public computer. If you boot a public computer in a hotel lobby or a library from a thumb drive, you'll know your operating environment is secure.
There are plenty of lightweight distributions out there, like [Lubuntu][2], [Peppermint OS][3], and [Bodhi][4], but there's something special about the truly tiny. Here are five tiny distros you owe it to yourself to try.
### Tiny Core
![Tiny Core Linux][5]
At 11MB for a text console and 16MB for a GUI, [Tiny Core Linux][6] is almost impossibly small. I dug through my collection of old thumb drives; the smallest one was 128MB, which is still eight times the size of Tiny Core's image.
By default, Tiny Core includes the base OS, assuming you have an Ethernet connection to the internet so you can install only the applications you need. It's such an extremely efficient model that it doesn't even include an application to install the OS (although you can download it from the Tiny Core repository when you're ready to install).
I've run Tiny Core from a 128MB thumb drive on a system with 512MB RAM, and the performance was excellent, as you might expect from an OS that takes only 16MB. Performance slows only when browsing the internet in a web browser, but the blame lies with the complexity of most modern websites more than Tiny Core.
Without a GUI, Tiny Core runs well on a mere 64MB of RAM.
#### Installation
[Download Tiny Core][7] and write it to a thumb drive with **dd** or [Etcher][8].
Installing Tiny Core is easy, once you download the **tc-install** or **tc-install-GUI** application using the **Apps** icon in the launcher bar at the bottom of the screen.
![Tiny Core installer][9]
You have several options to install Tiny Core. You can install it to a thumb drive formatted as a Linux drive (this requires your computer to allow booting from a USB drive, which is common in most modern PCs but was less common for older ones), to a Microsoft FAT thumb drive (a hack for PCs that don't normally boot from USB drives), or even to a directory in an existing Linux partition.
The installation is quick, and when you finish, you can reboot your computer and boot into your Tiny Core Linux OS.
#### Applications
Since it comes with little more than a text editor and a terminal, the first thing you should do is install some applications. The **Apps** icon in the bottom launcher bar displays all the Tiny Core packages available to you. The **Apps** repository also includes important drivers, so it's useful when you're looking to get a WiFi card or a printer working.
When installing a new application or utility, you can choose between having the package load into Tiny Core at boot time or on demand. Choosing to load a package at boot makes it available to you immediately and still available after a reboot (as you would expect). Choosing to load it on demand means the package is available after Tiny Core downloads the package, but after a reboot, it won't be loaded into memory. This may keep your boot time fast and Tiny Core's footprint in RAM tiny, but it also means the package data isn't loaded into memory until you use it for the first time each session.
The application selection is a good mix between user-centric apps, like office and graphics applications, and server-centric, such as [Samba][10] and web servers.
Of course, once you start adding applications to Tiny Core, it becomes less tiny. Even the **Tiny Core Plus** image, which includes all WiFi drivers, on the Tiny Core website is only about 100MB, so "less tiny" is likely still well under 256MB or so.
#### Bottom line
Tiny Core is ideal for old computers with few resources, network boot images, and anyone who values applications over the OS. Tiny Core is a great weekend project: build the OS you want from 16MB until you have just as much of an OS as you need.
### SliTaz
![SliTaz Linux][11]
The [SliTaz Linux][12] image is about 51MB, about four times the size of Tiny Core, with an impressive collection of drivers and applications included. In fact, if you didn't know better, you might think you booted into a 1GB Ubuntu image because everything you'd expect from a basic starter image is there: text editor, web browser, paint program, spreadsheet application, and so on.
I've run SliTaz from a 128MB thumb drive on a system with 512MB RAM, and the performance was excellent. Performance slows when browsing heavy websites, but the included lightweight [Midori][13] browser keeps most sites loading quickly.
At boot time, you can choose to run SliTaz without a GUI; it runs nicely on a mere 64MB of RAM.
#### Installation
There are many download options for SliTaz because its developers and community provide many variations for potential system limitations. For instance, there's a low RAM version for systems with as little as 24MB RAM, a version with Firefox instead of Midori, a version with no extra applications, and so on.
If you're overwhelmed by options and just want to try it out, [download the rolling release][14]. This version is roughly 50MB and is updated weekly. If you fall in love with SliTaz, you can choose a download that's better for your needs—if the rolling release proves to be _too_ fresh for you.
Once you've downloaded your choice of SliTaz image, write it to a thumb drive with **dd** or [Etcher][8] and reboot.
Installing SliTaz to a thumb drive or hard drive is done through the **TazPanel** application. It guides you through partitioning your disk (as needed) and installs SliTaz to the destination you choose.
![SliTaz installer][15]
#### Applications
The **TazPanel** application is SliTaz's control center. If you're a fan of OpenSUSE or Mageia (née Mandrake), you might find TazPanel familiar, at least in concept: it's a single application that provides access to system configuration, hardware detection, user and group management, system updates, and application installation.
Available applications satisfy most basic requirements, meaning if you're not picky about which application you use to accomplish a task, then SliTaz's repositories probably have something for you. If you have specific requirements (GIMP 2.10 instead of GIMP 2.8, for instance), then you'll have to learn how to generate SliTaz packages. The good news is that the **tazpkg** command can convert from several packaging formats, including:
* Debian packages (.deb, .udeb)
* RPM packages (.rpm)
* Slackware packages (.tgz)
* Puppy packages (.sfs, .pet)
* NuTyX packages (.cards.tar.xz)
* Arch and Alpine Linux packages (.apk, .pkg.tar.gz, .pkg.tar.xz)
* OpenWrt packages (.ipk, .opk)
* Paldo packages (.tar.bz2)
* Void packages (.xbps)
* Tiny Core packages (.tce, .tcel, .tcem, .tcz)
#### Bottom line
SliTaz is a fast, small Linux distribution with a centralized control panel that makes it easy to learn. Because its packaging tools can convert from other Linux packaging formats, its application selection is theoretically vast, making it easy for you to design your work environment with all your favorite tools. SliTaz is small but lethal, just like its arachnid logo.
### Porteus
![Porteus Linux][16]
[Porteus][17] offers a few desktop options, with the smallest image around 270MB and the largest 350MB. That makes it one of the largest of tiny Linux images, but most of that space is dedicated to ensuring a smooth Linux desktop experience, to the point that you'll likely forget you're using a live distribution. Installing Porteus to an SSD drive or loading it to RAM during boot results in such a flawlessly smooth environment that you won't believe your OS occupies less space than half a CD-ROM.
Porteus is tiny in the sense that its base image is comparatively small, but depending on the desktop you choose, it can easily require up to 1GB of RAM to run. While other tiny Linux distributions tend to capitalize on minimalist applications to preserve space and resources, Porteus expects you to use it as you would any other distribution. Install all your favorite apps and drivers and forget you're running on a tiny, compressed root filesystem.
#### Installation
Download Porteus from your [closest Porteus mirror][18], choosing from MATE, LXQT, LXDE, OpenBox, XFCE, Cinnamon, or KDE, depending upon your preference. If you have no preference, the MATE or KDE desktop are both good at balancing image size with a familiar-feeling desktop experience.
![Porteus installer][19]
opensource.com
You can install Porteus to a thumb drive or an internal hard drive using the instructions in the [official installation guide][20]. The process is similar either way and results in a compressed root filesystem that never changes. It's a stable and contained filesystem upon which you overlay your changes as you use it. When you reboot, changes you make and applications you install are loaded into memory, so your environment is just as you left it.
#### Applications
Applications are called "modules" in Porteus lingo and are available from the [Unified Slackware Package Manager][21] (USM), which draws from five different Slackware repositories, meaning you have plenty of applications to choose from.
#### Bottom line
Porteus is a full Linux experience with a fraction of the space usually required. It's an excellent portable Linux distribution with lots of desktop options and lots of applications.
### Bodhi Linux
![Bodhi Linux][22]
[Bodhi Linux][4] might not look tiny at first glance, with an ISO image of 740MB, but once it's installed, you'll be amazed at just how tiny it is. Bodhi runs smoothly on only 512MB of RAM but looks and feels like the desktop of tomorrow. Bodhi uses the [Enlightenment][23] desktop, a beautiful user interface that's lovingly crafted to be both small and powerful.
Bodhi doesn't just use Enlightenment, though, it adds to it. Bodhi's configuration applications and system setting panels are custom interfaces to Enlightenment's sometimes overwhelming array of options. Bodhi makes some sane default choices for you and provides a subset of options. If you're a die-hard Enlightenment user, Bodhi's interpretation might not be pure enough for you, but for many users, Bodhi brings focus to the Enlightenment desktop.
#### Installation
[Download Bodhi Linux][24], write it to a thumb drive with **dd** or [Etcher][8], and reboot.
The Bodhi installer is available from the **Applications** menu in the **Preferences** category. The installation application is **Ubiquity**, so the process is the same as installing Ubuntu. If you've never installed Ubuntu, don't worry; it's one of the easiest to install.
![Bodhi installer][25]
#### Applications
Bodhi is based on the latest long term support (LTS) Ubuntu Linux release, so your available software knows almost no bounds. If it's available for Ubuntu Linux, Bohdi has access to it.
#### Bottom line
Bodhi Linux is a step down from the size of a typical Ubuntu install and a step up from many other minimalist Ubuntu environments because it uses Enlightenment. If you're looking for a Linux distribution that runs lighter than most without resorting to overlay filesystems and application modules, then Bodhi is the distribution for you.
### Puppy Linux
![Puppy Linux][26]
Before there was Tiny Core or SliTaz or [AntiX][27] or Porteus, there was [Puppy Linux][28]. One of the original tiny Linux distributions, Puppy has endured for a decade and a half as a reliable, bootable OS for old computers and new users alike.
Upon first boot, Puppy does its best to guide the user through any necessary steps to ensure everything works as expected. It's a lot of windows to wade through, but once you get through it all, you know without a doubt what works and what doesn't before you choose whether to install.
Puppy is almost 300MB and failed to work on anything under 1GB RAM in my tests, so it's not exactly the tiniest Linux available. However, it's still a great, under-1GB operating system, and of the OSes in that category, it's one of the very friendliest.
#### Installation
[Download Puppy Linux][29] and write it to a thumb drive with **dd** or [Etcher][8] or burn it to a CD or DVD, then reboot.
![Puppy installer][30]
Puppy can install onto nearly anything that accepts data. The installer application, available from the top launcher bar, is called **Puppy Installer**, and it manages installing Puppy and applications for Puppy.
Puppy Installer steps you through the process of installing the OS onto whatever media you have available. Puppy can boot from a thumb drive, an optical disc, a hard drive, and even an SD card. I've used Puppy on a computer with no hard drive whatsoever, no working optical drive, and no option to boot from USB. Because Puppy can write your configuration options to just about anything, I was able to use it with persistent data storage to an external device.
#### Applications
The **Puppy Installer** application is also used to install apps onto Puppy. Because Puppy is based on Ubuntu, there aren't likely to be any Linux packages missing from its repositories, and if there are, you can probably use a [Flatpak][31].
#### Bottom line
Puppy is the original tiny Linux. While it's not the tiniest any more, it's by far the easiest.
### Bonus: Silverblue
![SilverBlue, not tiny, but tiny-adjacent][32]
The concept of tiny Linux has changed over the years. Long ago, a tiny Linux distribution was something you downloaded onto a CD-R and ran from your optical drive while saving changes to external media. Later, it was something you ran from a thumb drive with dedicated space for persistent changes. Now it's all of those things plus the ability to install to internal drives or directories.
What no one expected was for Linux to kick off the craze for containers, in which applications are self-contained Linux systems running in a para-virtualized environment. What was once a niche hobby for people who either loved to optimize disk space or who loved to resurrect ancient computers quickly became a salient requirement for developers who wanted to develop containers without adding too much overhead to their applications. All the work put into the minimalist, ephemeral Linux distributions suddenly paid off in an unexpected way.
With the concept of what a root filesystem looks like, the Fedora Project's [Silverblue][33] experiment is an effort to create an immutable OS. It's an operating system that never changes and instead gets updates and application installs in the form of, essentially, containers.
Silverblue at 2.1GB is by no means a tiny Linux distribution, but in many ways, it's a child of the tiny Linux and container movements.
#### Installation
[Download Silverblue][34] and write it to a thumb drive with **dd** or [Etcher][8] or burn it to a CD or DVD, then reboot.
After booting into Silverblue, install it to an internal hard drive using [Anaconda][35], the standard, friendly Fedora Linux installer.
![Anaconda installer][36]
#### Applications
Silverblue doesn't install applications in the traditional sense; instead, it runs containers over the top of its base OS. Specifically, it uses Flatpaks for GUI applications and [Toolbox][37] for commands.
Because Flatpaks aren't nearly as common as traditional Fedora RPM packages, Silverblue also provides **package layering**, a way to convert Fedora RPM packages to Silverblue.
#### Bottom line
Silverblue could be a fun experiment testing out emerging technology, or it could be the future of the desktop OS. It's tiny only in the sense that its root filesystem remains the same size regardless of updates and applications added onto it, but it's worth looking at to see where the strange obsession with tiny distributions has delivered the Linux community and industry. Don't forget to tip your hat to the 11MB pioneers on your way out.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/6/linux-distros-to-try
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth/users/marcobravo
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
[2]: http://lubuntu.net
[3]: http://peppermintos.com
[4]: https://www.bodhilinux.com/
[5]: https://opensource.com/sites/default/files/uploads/tinycore.jpg (Tiny Core Linux)
[6]: http://tinycorelinux.net/
[7]: http://tinycorelinux.net/welcome.html
[8]: https://www.balena.io/etcher/
[9]: https://opensource.com/sites/default/files/uploads/tc-install-gui.png (Tiny Core installer)
[10]: https://www.samba.org/
[11]: https://opensource.com/sites/default/files/uploads/slitaz.jpg (SliTaz Linux)
[12]: http://www.slitaz.org/en/
[13]: https://github.com/midori-browser/core
[14]: http://slitaz.org/en/get/#rolling
[15]: https://opensource.com/sites/default/files/uploads/slitaz-install.jpg (SliTaz installer)
[16]: https://opensource.com/sites/default/files/uploads/porteus.jpg (Porteus Linux)
[17]: http://www.porteus.org/
[18]: http://porteus.org/porteus-mirrors.txt
[19]: https://opensource.com/sites/default/files/images/porteus-installer.png (Porteus installer)
[20]: http://www.porteus.org/component/content/article/26-tutorials/general-info-tutorials/114-official-porteus-installation-guide.html
[21]: http://www.porteus.org/tutorials/9-modules/149-usm.html
[22]: https://opensource.com/sites/default/files/uploads/bodhi.jpg (Bodhi Linux)
[23]: https://www.enlightenment.org/
[24]: https://www.bodhilinux.com/download
[25]: https://opensource.com/sites/default/files/uploads/bodhi-install.jpg (Bodhi installer)
[26]: https://opensource.com/sites/default/files/uploads/puppy.jpg (Puppy Linux)
[27]: https://antixlinux.com/
[28]: http://puppylinux.com/
[29]: http://puppylinux.com/index.html#download
[30]: https://opensource.com/sites/default/files/uploads/puppy-install.jpg (Puppy installer)
[31]: https://docs.fedoraproject.org/en-US/fedora-silverblue/getting-started/#flatpak
[32]: https://opensource.com/sites/default/files/uploads/silverblue.jpg (SilverBlue, not tiny, but tiny-adjacent)
[33]: https://silverblue.fedoraproject.org/
[34]: https://silverblue.fedoraproject.org/download
[35]: https://fedoraproject.org/wiki/Anaconda
[36]: https://opensource.com/sites/default/files/uploads/silverblue-install.jpg (Anaconda installer)
[37]: https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/

View File

@ -0,0 +1,93 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The innovation delusion)
[#]: via: (https://opensource.com/open-organization/19/6/innovation-delusion)
[#]: author: (Jim Whitehurst https://opensource.com/users/jwhitehurst/users/jwhitehurst/users/n8chz/users/dhdeans)
The innovation delusion
======
Innovation is a messy process. Our stories about it aren't. We shouldn't
confuse the two.
![gears and lightbulb to represent innovation][1]
If [traditional planning is dead][2], then why do so many organizations still invest in planning techniques optimized for the Industrial Revolution?
One reason might be that we trick ourselves into thinking innovation is the kind of thing we can accomplish with a structured, linear process. When we do this, I think we're confusing our _stories_ about innovation with the _process_ of innovation itself—and the two are very different.
The _process_ of innovation is chaotic and unpredictable. It doesn't operate according to clean, regimented timelines. It's filled with iterative phases, sudden changes in direction, various starts and stops, dead ends, (hopefully productive) failures, and unknowable variables. It's messy.
But the stories we tell ourselves about innovation, including the books and articles we read about great inventions and the tales we tell each other about our successes in the workplace, tidy that process up. Think about how many social media posts you've seen that feature nothing but the "high points."
That's the nature of good storytelling. It takes a naturally scattered collection of moments and puts them neatly into a beginning, middle, and end. It smoothes out all the rough patches and makes a result seem inevitable from the start, despite whatever moments of uncertainty, panic, even despair we experienced along the way.
We shouldn't confuse messy process with simplified story. When we do, we might mistakenly assume we can approach innovation challenges with the same practices we bring to neat and linear processes. In other words, we apply a set of management techniques appropriate for one set of activities (for more rote, mechanical, and prescriptive tasks) to a set of activities they aren't really suited for (more creative, non-linear work requiring autonomy and experimentation).
If traditional planning is dead, then why do so many organizations still invest in planning techniques optimized for the Industrial Revolution?
### An innovation story
Here's [one of my favorite examples][2] of how this idea in action.
In the 1970s, the British motorcycle industry was desperately trying to figure out why its U.S. market share was plummeting while Honda's was skyrocketing. The company hired my former employer, the Boston Consulting Group, to help them figure out what was going wrong. BCG gathered some historical data, reviewed a two-decade sequence of events, and developed a neat, linear story explaining Honda's success.
Honda, [BCG concluded][3], had executed an ingenious strategy: enter the U.S market with smaller motorcycles it could sell at lower cost, use the economies of scale it had developed in the Japense market to set low prices and grow a market, then further leverage those economies of scale to grow their share in the States as demand grew. By all accounts, Honda had done it brilliantly, playing to its strengths while thoroughly and accurately assessing the new, target U.S. consumer. It had outsmarted, outflanked, and outperformed competitors with a well-executed plan.
It _sounded_ great. But the reality was much less straightforward.
Yes, Honda _did_ want to enter the U.S. motorcycle market. It initially attempted to [copy its competitors there][4], building the larger bikes Americans seemed to favor. But bikes like that weren't one of Honda's strengths, and their versions had reliability issues. To make matters worse, their models didn't look much different than other offerings already in the market, so they weren't standing out. Suffice it to say, sales were not booming.
But in a happy coincidence, Honda's Japanese representatives visiting the States had brought their own motorcycles with them. Those bikes were different than the ones the company was attempting to sell to the American market. They were smaller, zippier, less bulky, more efficient, and generally less expensive. Sears took notice, contacted the reps, and the companies struck a deal that let Sears carry this new motorcycle—called the "Super Cub"—in its American stores.
And the rest, as they say, is history. The Super Cub would go on to become the [best-selling motorized vehicle of all time][5], and Honda [continues to produce it today][6].
In hindsight, the events that brought the Super Cub to the U.S. seem logical, almost boring. But Honda owed its success less to an ingenious master plan and much more to serendipity and happenstance than most people care to admit.
When success depends on things we don't or can't predict, is getting exactly what you've planned for good enough?
### Open (and messy) innovation
Organizations (and especially leaders) like to think that success is always planned—that they've become masters of chaos and can almost predict the future. But they're often making those assessments with the benefit of hindsight, telling the stories of their haphazard journey in a way that organizes the chaos, essentially reflecting on a period of uncertainty and saying "we meant to do that."
But as I said, we shouldn't assume those stories are mirror reflections of the innovation process itself and build future initiatives or experiments on that mistaken assumption.
Imagine another motorcycle manufacturer looking to replicate Honda's success with the Super Cub by following BCG's narrative to the letter. Because the _story_ of Honda's success seems so logical and linear, the new company might assume it could use similar processes and get the same results: plan objectives, prescribe behaviors, and execute against knowable outcomes. But we know that Honda didn't really win its market with that kind of "plan, prescribe, execute" mentality. It won through flexibility and a bit of blind luck—something more like "[try, learn, modify][7]."
When we're able to appreciate and accept that the innovation process is messy, we allow ourselves to think differently about approaching innovation in our organizations. We can begin building the kinds of open and agile organizations capable of _responding to innovation as it happens_ instead of over-investing resources into pre-formed plans that try to _force_ innovation into a linear timeline.
I saw this kind of approach several years ago, when Red Hat released a new version of a product that included a major technology update. [Version 5.4 of Red Hat Enterprise Linux][8] was the first to include full support for a technology called the Kernel-based Virtual Machine (or "KVM"). For us it was a significant innovation that promised to deliver immense value not only to customers and partners, but also to open source software communities.
The technology was evolving quickly. Luckily, because we're an open organization, we were adaptable enough to respond to that innovation as it was happening and help our customers and partners take advantage of it. It was too important, and the competitive landscape too volatile, to justify withholding just so we could "save" it for a milestone moment like version 6.0.
When you go back and review [the archived release notes][9] for Red Hat Enterprise Linux, you'll see that it doesn't "read" like a typical software innovation tale. A game-changing development pops up at an unpredicted and unremarkable moment (version 5.4), rather than a pre-planned blockbuster milestone (version 6.0). In hindsight, we now know that KVM _was_ the kind of "big bang" advancement that could have warranted a milestone release name like "6.0." But that's just not how the innovation process unfolded.
Don't get me wrong, organizations still need to maintain operational excellence and perform execution-oriented tasks well. But [different kinds of challenges require different kinds of approaches][10], and we need to get better at building flexible organizations just as capable of [responding to the unforeseen or unknowable][11].
An organization great at planning (and executing against that plan) will quite likely get the results it planned for. But when success depends on things we _don't_ or _can't_ predict, is getting exactly what you've planned for good enough?
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/19/6/innovation-delusion
作者:[Jim Whitehurst][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jwhitehurst/users/jwhitehurst/users/n8chz/users/dhdeans
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation)
[2]: https://www.youtube.com/watch?v=8MCbJmZQM9c
[3]: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/235319/0532.pdf
[4]: http://www.howardyu.org/the-revolutionary-approach-honda-took-to-rise-above-competition/
[5]: https://autoweek.com/article/motorcycles/first-ride-honda-super-cub-c125-abs-all-new-and-still-super-cute
[6]: https://www.autoblog.com/2019/02/13/2019-honda-super-cub-first-ride-review/
[7]: https://opensource.com/open-organization/18/3/try-learn-modify
[8]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.4_release_notes/index
[9]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.0_release_notes/index
[10]: https://opensource.com/open-organization/19/4/managed-enabled-empowered
[11]: https://www.linkedin.com/pulse/how-plan-world-full-unknowns-jim-whitehurst/

View File

@ -0,0 +1,117 @@
[#]: collector: (lujun9972)
[#]: translator: (luuming)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (When to be concerned about memory levels on Linux)
[#]: via: (https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
何时需要关注 linux 的内存层面?
======
Linux 上的内存管理很复杂。尽管使用率高但未必存在问题。你也应当关注一些其他的事情。
![Qfamily \(CC BY 2.0\)][1]
在 Linux 上用光内存通常并不意味着存在严重的问题。为什么?因为健康的 Linux 系统会在内存中缓存磁盘活动,基本上占用掉了未被使用的内存,这显然是一件好事情。
换句话说它不让内存浪费掉。使用空闲的内存增加磁盘访问速度并且不占用运行中应用程序的内存。你也能够想到使用这种内存缓存比起直接访问硬盘驱动HDD快上数百倍也比明显快于直接访问固态硬盘驱动。内存占满或几乎占满通常意味着系统正在尽可能高效地运行当中——并不是运行中遇到了问题。
### 缓存如何工作
磁盘缓存简单地意味着系统充分利用未使用的资源(空闲内存)来加速磁盘读取与写入。应用程序不会失去任何东西,并且大多数时间里能够按需求获得更多的内存。此外,磁盘缓存不会导致应用程序使用交换分区。反而,用作磁盘缓存的内存空间当被需要时会立即归还,并且磁盘内容会被更新。
### 主要和次要的页故障
Linux 系统通过分割物理内存为进程分配空间,将分割成的块称为“页”,并且映射这些页到每个进程的虚拟内存上。不再会用到的页也许会从内存中移除,尽管相关的进程还在运行。当进程需要一个没有被映射或没在内存中页时,故障便会产生。所以,“<ruby>故障<rt>fault</rt></ruby>”并不意味着“<ruby>错误<rt>error</rt></ruby>”而是“<ruby>不可用<rt>unavailables</rt></ruby>”,并且故障在内存管理中扮演者一个重要的角色。
次要故障意味着在内存中的页未分配给请求的进程或未在内存管理单元中标记为出现。主要故障意味着页不保留在内存中。
如果你想切身感受一下次要页故障和主要页故障出现的频率,像这样试一下 `ps` 命令。注意我们要的是与页故障和产生它的命令相关的项。输出中省略了很多行。`MINFL` 显示出次要故障的数目,而 `MAJFL` 表示了主要故障的数目。
```
$ ps -eo min_flt,maj_flt,cmd
MINFL MAJFL CMD
230760 150 /usr/lib/systemd/systemd --switched-root --system --deserialize 18
0 0 [kthreadd]
0 0 [rcu_gp]
0 0 [rcu_par_gp]
0 0 [kworker/0:0H-kblockd]
...
166 20 gpg-agent --homedir /var/lib/fwupd/gnupg --use-standard-socket --daemon
525 1 /usr/libexec/gvfsd-trash --spawner :1.16 /org/gtk/gvfs/exec_spaw/0
4966 4 /usr/libexec/gnome-terminal-server
3617 0 bash
0 0 [kworker/1:0H-kblockd]
927 0 gdm-session-worker [pam/gdm-password]
```
汇报单一进程,你可以尝试这样的命令:
```
$ ps -o min_flt,maj_flt 1
MINFL MAJFL
230064 150
```
你也可以添加其他的项,例如进程所有者的 UID 和 GID。
```
$ ps -o min_flt,maj_flt,cmd,args,uid,gid 1
MINFL MAJFL CMD COMMAND UID GID
230064 150 /usr/lib/systemd/systemd -- /usr/lib/systemd/systemd -- 0 0
```
### 多少才算满?
一种较好的方法来掌握内存究竟使用了多少是用 `free -m` 命令。`-m` 选项指定了数字的单位是 <ruby>MiBs<rt>mebibytes</rt></ruby> 而不是字节。
```
$ free -m
total used free shared buff/cache available
Mem: 3244 3069 35 49 140 667
Swap: 3535 0 3535
```
注意 `free`(未使用)的内存可能会不足,而 `available`(可用于启动新的应用)会显示更大的数量。这两者的区别值得我们去关注。<ruby>可用<rt>available</rt></ruby>意味着它可以在需要时恢复使用,而<ruby>空闲<rt>free</rt></ruby>意味着现在就能够使用。
### 什么时候要担心
如果 Linux 系统上的性能表现良好——应用程序响应度高,命令行没有显示出问题——很可能系统状况良好。记住,一些应用也许会出于某种原因而变慢,但它不影响整个系统。
过多的硬故障也许表明确实存在问题,但要将其与观察到的性能相比较。
一个好的方法是当可用内存接近 0 或者“<ruby>用作交换<rt>swap used</rt></ruby>”项显著增长或波动时开始担心。如果“可用”项占总内存可用量的百分比合理,那么就无需担心,就像下面的例子那样:
```
$ free -m
total used free shared buff/cache available
Mem: 3244 3069 35 49 140 667
Swap: 3535 0 3535
```
### Linux 性能很复杂
把所有的放在一边Linux 系统上的内存可能会变满,并且性能可能会降低。当系统出现问题时不要仅将单一的内存使用报告作为指标。
Linux 系统的内存管理很复杂,因为它采取的措施需要确保系统资源得到最好的利用。不要受到一开始内存占满的欺骗,使你认为系统存在问题,但实际上并没有。
在 [Facebook][4] 和 [LinkedIn][5] 上加入网络研讨会发表你的评论。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[LuuMing](https://github.com/LuuMing)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://images.idgesg.net/images/article/2019/05/full-swimming-pool-100796221-large.jpg
[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html
[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua
[4]: https://www.facebook.com/NetworkWorld/
[5]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,192 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Using i3 with multiple monitors)
[#]: via: (https://fedoramagazine.org/using-i3-with-multiple-monitors/)
[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/)
将 i3 与多个显示器配合使用
======
![][1]
你在 Linux 工作站上使用多个显示器吗?一次看到很多东西可能是有益的。但在我们的工作中通常有比实际显示器更多的窗口 - 这是一件好事,因为一次看到太多东西可能会分散注意力。因此能够切换我们在单个显示器上看到的内容似乎很重要。
让我们来谈谈 i3它是一个流行的平铺窗口管理器可以与多个显示器配合使用。并且有许多其他窗口管理器没有的便利功能它能够独立地在各个显示器上切换工作区。
### 快速介绍 i3
大约三年前,[Fedora Magazine 已经写了一篇关于 i3 的文章][2]。这是有史以来最受欢迎的文章之一!虽然情况并非总是如此,但 i3 非常稳定,而且这篇文章如今也很准确。所以,这次不会重复太多,本篇只涵盖了让 i3 启动和运行,如果你是 i3 的新手,想要了解更多基础知识的话,欢迎你继续阅读。
要在系统上安装 i3请运行以下命令
```
$ sudo dnf install i3
```
完成后,注销,然后在登录屏幕上选择 i3 作为窗口管理器,然后重新登录。
当你第一次运行 i3 时,系统会询问你是否要继续进行自动配置 - 在此处回答是。之后,你将被要求选择 “mod 键”。如果你在这里不确定,只需接受默认值,即将 Windows/Super 键设置为 mod 键。你将主要使用此键用于窗口管理器中的快捷方式。
此时,你应该在底部看到一个小条和一个空白屏幕。我们来看看一些基本的快捷方式。
打开终端:
```
$mod + enter
```
切换到第二个工作区:
```
$mod + 2
```
通过以下两个步骤打开 firefox首先
```
$mod + d
```
然后输入 “firefox” 并按回车键。
将其移动到第一个工作区:
```
$mod + shift + 1
```
切换到第一个工作区:
```
$mod + 1
```
此时,你将并排看到一个终端和一个 firefox 窗口。要关闭窗口,请按:
```
$mod + shift + q
```
还有更多的快捷方式,但这些足够让你开始使用 i3。
要退出 i3退出登录
```
$mod + shift + e
```
然后在右上角使用鼠标确认。
### 同时让多个屏幕工作
现在我们已经启动并运行了 i3让我们把所有这些屏幕都用到
为此,我们需要使用命令行,因为 i3 非常轻量级,并且没有 gui 来管理其他屏幕。如果这听起来很难也不用担心,它实际上非常简单!
我们将使用的命令称为 xrandr。如果你的系统上没有 xrandr请运行以下命令安装
```
$ sudo dnf install xrandr
```
当它安装完毕后,让我们继续运行它:
```
$ xrandr
```
输出列出了所有可用输出,并通过显示支持的分辨率指示哪些输出连接了屏幕(通过电缆连接的显示器)。好消息是,我们不需要关心使它们工作的分辨率。
这个例子显示了笔记本电脑的主屏幕(名为 eDP1以及连接到 HDMI-2 输出的第二个显示器,它位于笔记本电脑的右侧。要打开它,请运行以下命令:
```
$ xrandr --output HDMI-2 --auto --right-of eDP1
```
就是这样!你的屏幕现已激活。
![Second screen active. The commands shown on this screenshot are slightly different than in the article, as they set a smaller resolution to make the screenshots more readable.][3]
### 在多个屏幕上管理工作区
在多个屏幕上切换工作区和创建新工作区非常类似于只有一个屏幕的情况。新工作区会在当前处于活动状态(鼠标光标所在位置)的屏幕上创建。
因此,要切换到特定工作区(或在不存在的情况下创建新工作区),请按:
```
$mod + NUMBER
```
你可以独立切换各个显示器上的工作区!
![Workspace 2 on the left screen, workspace 4 on the right screen.][4]
![Left screen switched to workspace 3, right screen still showing workspace 4.][5]
![Right screen switched to workspace 4, left screen still showing workspace 3.][6]
### 在显示器之间移动工作区
我们可以通过以下命令将窗口移动到不同的工作区:
```
$mod + shift + NUMBER
```
我们也可以将工作区移动到不同的屏幕。但是,此操作没有默认快捷方式,因此我们必须先创建它。
要创建自定义快捷方式,你需要在你选择的文本编辑器中打开配置文件(本文使用 _vim_
```
$ vim ~/.config/i3/config
```
并将以下行添加到配置文件的最底部:
```
# Moving workspaces between screens
bindsym $mod+p move workspace to output right
```
保存、关闭并重新加载以使配置生效,按下:
```
$mod + shift + r
```
现在你可以将活跃的工作区移动到第二个显示器:
```
$mod + p
```
![Workspace 2 with Firefox on the left screen][7]
![Workspace 2 with Firefox moved to the second screen][8]
就是这些了!享受你的新多显示器体验,并了解更多 i3欢迎阅读 Fedora Magazine 上之前关于 i3 的文章,或者查看官方 i3 文档。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/using-i3-with-multiple-monitors/
作者:[Adam Šamalík][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/asamalik/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/i3-title-816x345.jpg
[2]: https://fedoramagazine.org/getting-started-i3-window-manager/
[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/0-1-1024x384.png
[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-1-1024x384.png
[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-2-1024x384.png
[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-3-1024x384.png
[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-1-1024x384.png
[8]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-2-1024x384.png