Merge pull request #1 from LCTT/master

PR
This commit is contained in:
YungeGuo 2021-08-11 19:41:11 +08:00 committed by GitHub
commit 37da3565b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 2523 additions and 632 deletions

View File

@ -0,0 +1,120 @@
[#]: subject: "3 essential Linux cheat sheets for productivity"
[#]: via: "https://opensource.com/article/21/4/linux-cheat-sheets"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "YungeG"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13662-1.html"
3 个提高生产力的必备 Linux 速查表
======
> 下载 `sed`、`grep` 和 `parted` 的速查表来整合新的流程到你的工作中。
![](https://img.linux.net.cn/data/attachment/album/202108/09/121350vvha4adg77b77j7c.jpg)
Linux 因其命令闻名,部分原因是 Linux 执行的几乎所有操作都可以从终端调用;另一部分原因是 Linux 是一个高度模块化的操作系统它的工具被设计用于产生十分确定的结果在非常了解一些命令后你可以将这些命令进行奇妙的组合产生有用的输出。Linux 的学习过程一半是学习命令,另一半是学习如何将这些命令连成有意思的组合。
然而有这么多 Linux 命令需要学习,迈出第一步似乎令人望而生畏。应该先学习哪一个命令?有那些命令需要熟练掌握,又有哪些命令只需要浅尝辄止?认真考虑过这些问题后,我个人不相信有一个通用的答案。对所有人来说,“基本”命令很可能是相同的:
* `ls`
* `cd`
* `mv`
有这些命令你就可以浏览自己的 Linux 文件系统。
但是,除了基本命令,不同行业的“默认”命令有所不同。系统管理员需要 [系统自我检查和监测][2] 的工具;艺术家需要 [媒体转换][3] 和 [图形处理][4] 工具;家庭用户可能想要 [PDF 处理][5]、[日历][6]、[文档转换][7] 工具。这份列表无穷无尽。
然而一些 Linux 命令由于极其重要能够脱颖而出 —— 或者因为这些命令是每个人不时需要的常用的底层工具,或者因为这些命令是每个人在大多数时间都会觉得有用的万能工具。
这里有三个需要添加到你的列表中的命令。
### Sed
**用途:** `sed` 是一个任何 Linux 用户都可以从学习中获益的优良通用工具。从表面上看,它只是一个基于终端的“查找和替换”,能够简单快速地纠正多个文档。`sed` 命令为我节省了打开单个文件、寻找和替换一个单词、保存文件、关闭文件所需要的数个小时(也可能是数天)时间,仅此一条命令就证明了我在学习 Linux 终端的投入是合理的。一旦充分了解 `sed`,你很有可能发现一个使生活更加轻松的潜在编辑技巧世界。
**长处:** 命令的长处在于重复。如果你只有一个要编辑的文件,很容易在传统的 [文本编辑器][8]打开并进行“查找和替换”。然而,如果要替换 5 或 50 个文件,恰当地使用 `sed` 命令(可能结合 [GNU Parallel][9] 进行加速)可以帮你节省数个小时。
**不足:** 你需要权衡直接更改期望所花的时间和构建正确的 `sed` 命令可能需要的时间。使用常见的 `sed 's/foo/bar/g'` 语法所做的简单编辑通常值得上输入这些命令所花的时间;但是利用保持空间和任何 `ed` 形式子命令的复杂 `sed` 命令可能需要高度集中的注意力和多次的试错。事实证明,使用 `sed` 进行编辑通常是更好的方式。
**秘技:** 下载我们的 [sed 速查表][10] 获取命令的单字母子命令和语法概述的快速参考。
### Grep
**用途:** `grep` 一词来源于其公认的笨拙描述:全局正则表达式打印。换言之,在文件中(或者其他形式的输入中)找到的任何匹配模式,`grep` 都会打印到终端。这使得 `grep` 成为一个强大的搜索工具,尤其擅长处理大量的文本。
你可以使用 `grep` 查找 URL
```
$ grep --only-matching \
http\:\/\/.* example.txt
```
你可以使用 `grep` 查找一个特定的配置项:
```
$ grep --line-number \
foo= example.ini
2:foo=true
```
当然,你还可以将 `grep` 和其他命令组合:
```
$ grep foo= example.ini | cut -d= -f2
true
```
**长处:** `grep` 是一个简单的搜索命令,如果你阅读了上面的例子,就已经基本有所了解。为了增强灵活性,你可以使用命令的扩展正则表达式语法。
**不足:** `grep` 的问题也是它的长处:它只有搜索功能。一旦你找到想要的内容,可能会面临一个更大的问题 —— 如何处理找到的内容。有时进行的处理可能简单如重定向输出到一个文件,作为过滤后的结果列表。但是,更复杂的使用场景可能需要对结果做进一步处理,或者使用许多类似 [awk][11]、[curl][12](凑巧的是,我们也有 [curl 速查表][13])的命令,或者使用现代计算机上你所拥有的数千个其他选项中的任何一个命令。
**秘技:** 下载我们的 [grep 速查表][14] 获取更多命令选项和正则表达式语法的快速参考。
### Parted
**用途:** GNU `parted` 不是一个常用命令,但它是最强大的硬盘操作工具之一。关于硬盘驱动器的沮丧事实是 —— 数年来你一直忽略它们,直到需要设置一个新的硬盘时,才会想起自己对于格式化驱动器的最好方式一无所知,而此时熟悉 `parted` 会十分有用。GNU `parted` 能够创建磁盘卷标,新建、备份、恢复分区。此外,你可以通过命令获取驱动器及其布局的许多信息,并为文件系统初始化驱动器。
**长处:** 我偏爱 `parted` 而不是 `fdisk` 等类似工具的原因在于它组合了简单的交互模式和完全的非交互选项。不管你如何使用 `parted`,它的命令符合相同的语法,其编写良好的帮助菜单包含了丰富的信息。更棒的是,命令本身是 _智能_ 的 —— 给一个驱动器分区时,你可以用扇区和百分比指明分区的大小,`parted` 会尽可能计算出更精细的位置存放分区表。
**不足:** 在很长一段时间内我不清楚驱动器的工作原理,因此切换到 Linux 后,我花费了很长时间学习 GNU `parted`。GNU `parted` 和大多数终端磁盘工具假定你已经知晓什么是一个分区、驱动器由扇区组成、初始时驱动器缺少文件系统,需要磁盘卷标和分区表等等知识。硬盘驱动器的基础而不是命令本身的学习曲线十分陡峭,而 GNU `parted` 并没有做太多的努力来弥补潜在的认知差距。可以说,带你完成磁盘驱动器的基础知识学习不是命令的职责,因为有类似的 [图形应用][15],但是一个聚焦于工作流程的选项对于 GNU `parted` 可能是一个有用的附加功能。
**秘技:** 下载我们的 [parted 速查表][16] 获取大量子命令和选项的快速参考。
### 了解更多
这是一些我最喜欢的命令列表,但是其中的命令自然取决于我如何使用自己的计算机。我编写很多命令解释器脚本,因此频繁地使用 `grep` 查找配置选项,通过 `sed` 编辑文本。我还会用到 `parted`,因为处理多媒体项目时,通常涉及很多硬盘驱动器。你可能已经开发了,或者很快就要使用最喜欢的(至少是 _频繁使用的_)命令开发自己的工作流程。
整合新的流程到日常工作时,我会创建或者下载一个速查表(就像上面的链接),然后进行练习。我们都有自己的学习方式,找出最适合你的方式,学习一个新的必需命令。你对最常使用的命令了解越多,你就越能充分地使用它们。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/4/linux-cheat-sheets
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[YungeG](https://github.com/YungeG)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[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]: https://opensource.com/life/16/2/open-source-tools-system-monitoring
[3]: https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats
[4]: https://opensource.com/article/17/8/imagemagick
[5]: https://opensource.com/article/20/8/reduce-pdf
[6]: https://opensource.com/article/19/4/calendar-git
[7]: https://opensource.com/article/20/5/pandoc-cheat-sheet
[8]: https://opensource.com/article/21/2/open-source-text-editors
[9]: https://opensource.com/article/18/5/gnu-parallel
[10]: https://opensource.com/downloads/sed-cheat-sheet
[11]: https://opensource.com/article/20/9/awk-ebook
[12]: https://www.redhat.com/sysadmin/social-media-curl
[13]: https://opensource.com/article/20/5/curl-cheat-sheet
[14]: https://opensource.com/downloads/grep-cheat-sheet
[15]: https://opensource.com/article/18/11/partition-format-drive-linux#gui
[16]: https://opensource.com/downloads/parted-cheat-sheet

View File

@ -3,26 +3,24 @@
[#]: author: (mahesh1b https://fedoramagazine.org/author/mahesh1b/)
[#]: collector: (lujun9972)
[#]: translator: (perfiffer)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13664-1.html)
Command line quick tips: wc, sort, sed and tr
一些命令行小技巧wc、sort、sed 和 tr
======
![][1]
图片由 Ryan Lerch 提供(遵循 CC BY-SA 4.0 协议)
![](https://img.linux.net.cn/data/attachment/album/202108/10/085720hyd795y1wrmd5rx9.jpg)
Linux 发行版十分好用,而且它们有一些用户可能不知道的技巧。让我们来看看一些命令行实用工具,当你热衷于终端而不是 GUI 时,它们可能更顺手。
我们都知道在一个系统上使用终端会更高效。当你编辑和排版一个文本文件时,终端会让你确切的感受到,生活如此简单。
本文将向你介绍 wcsorttr和 sed 命令。
本文将向你介绍 `wc`、`sort`、`tr` 和 `sed` 命令。
## **wc**
### wc
wc 是一个实用工具,全称是 "word count"。顾名思义,它可以用来统计任何文件的行数、单词数和字节数。
`wc` 是一个实用工具,全称是 “word count”。顾名思义,它可以用来统计任何文件的行数、单词数和字节数。
让我们来看看它是如何工作的:
@ -31,22 +29,20 @@ $ wc filename
lines words characters filename
```
输出的是文件的行数,单词数,字符数和文件名。
输出的是文件的行数、单词数、字符数和文件名。
想获得特定的输出,我们必须使用选项:
* -c 打印字节总数
* -l 打印行数
* -w 打印单词总数
* -m 打印字符总数
* `-c` 打印字节总数
* `-l` 打印行数
* `-w` 打印单词总数
* `-m` 打印字符总数
#### wc 示例
让我们来看看它的运行结果。
### wc 示例
让我们来看看它的运行结果:
让我们从一个文本文件 “lormipsm.txt” 开始。首先,我们通过 cat 查看文件内容,然后使用 wc。
让我们从一个文本文件 `lormipsm.txt` 开始。首先,我们通过 `cat` 查看文件内容,然后使用 `wc`
```
$ cat loremipsm.txt
@ -86,36 +82,34 @@ $ wc -m loremipsm.txt
268 loremipsm.txt
```
## **sort**
### sort
sort 命令是最有用的工具之一。它会对文件的数据进行排序。可以根据字符或数字进行升序或降序排列。它也可以用来对文件中的行进行排序和随机化。
`sort` 命令是最有用的工具之一。它会对文件的数据进行排序。可以根据字符或数字进行升序或降序排列。它也可以用来对文件中的行进行排序和随机化。
使用 sort 非常简单。我们需要做的仅仅是提供一个文件名
使用 `sort` 非常简单。我们需要做的仅仅是提供一个文件名
```
$ sort filename
```
默认的是按照字母顺序对数据进行排序。需要注意的是 sort 命令仅仅是对数据进行排序展示。它并不会改写文件。
默认的是按照字母顺序对数据进行排序。需要注意的是 `sort` 命令仅仅是对数据进行排序展示。它并不会改写文件。
使用 sort 命令的一些有用的选项:
使用 `sort` 命令的一些有用的选项:
* -r 将文件中的行按倒序进行排序
* -R 将文件中的行打乱为随机顺序
* -o 将输出保存到另一个文件中
* -k 按照特定列进行排序
* -t 使用指定的分隔符,而不使用空格
* -n 根据数值对数据进行排序
* `-r` 将文件中的行按倒序进行排序
* `-R` 将文件中的行打乱为随机顺序
* `-o` 将输出保存到另一个文件中
* `-k` 按照特定列进行排序
* `-t` 使用指定的分隔符,而不使用空格
* `-n` 根据数值对数据进行排序
#### sort 示例
让我们看看 `sort` 的几个简单示例。
### sort 示例
我们有一个 `list.txt` 的文件,包含逗号分隔的名称和数值。
让我们看看 sort 的几个简单示例:
我们有一个 list.txt 的文件,包含逗号分隔的名称和数值。
首先让我们打印出文件内容并简单排序。
首先让我们打印出文件内容并简单排序:
```
$ cat list.txt
@ -143,7 +137,7 @@ Ruden Dyer, 3
Shyam Head, 2
```
现在对数据进行倒序排序
现在对数据进行倒序排序
```
$ sort -r list.txt
@ -159,7 +153,7 @@ Ananya Lamb, 5
Adelina Rowland, 4
```
让我们打乱数据
让我们打乱数据
```
$ sort -R list.txt
@ -175,7 +169,7 @@ Ananya Lamb, 5
Shyam Head, 2
```
来看一点更复杂的。这次我们根据第二个字段,也就是数值对数据进行排序,并使用 -o 选项将输出保存到另一个文件中。
来看一点更复杂的。这次我们根据第二个字段,也就是数值对数据进行排序,并使用 `-o` 选项将输出保存到另一个文件中:
```
$ sort -n -k2 -t ',' -o sorted_list.txt list.txt
@ -194,13 +188,13 @@ Cieran Wilks, 9
Kristian Felix, 10
```
这里我们使用 -n 选项按数字顺序进行排序,-k 选项用来指定要排序的字段(在本例中为第 2 个字段),-t 选项指定分隔符或字段分隔符(逗号),-o 选项将输出保存到 sorted_list.txt 文件中。
这里我们使用 `-n` 选项按数字顺序进行排序,`-k` 选项用来指定要排序的字段(在本例中为第 2 个字段),`-t` 选项指定分隔符或字段分隔符(逗号),`-o` 选项将输出保存到 `sorted_list.txt` 文件中。
## **sed**
### sed
Sed 是一个流编辑器,用于过滤和转换输出中的文本。这意味着我们不需要对原文件进行修改,只需要对输出进行修改。如果需要,我们可以将更改保存到一个新的文件中。Sed 提供了很多有用的选项用于过滤和编辑数据。
`sed` 是一个流编辑器,用于过滤和转换输出中的文本。这意味着我们不需要对原文件进行修改,只需要对输出进行修改。如果需要,我们可以将更改保存到一个新的文件中。`sed` 提供了很多有用的选项用于过滤和编辑数据。
sed 的语法格式如下:
`sed` 的语法格式如下:
```
$ sed [OPTION] PATTERN filename
@ -208,18 +202,16 @@ $ sed [OPTION] PATTERN filename
sed 常用的一些选项:
* -n : 取消默认输出
* p : 打印指定的数据 
* d : 删除指定行
* q : 退出 sed 脚本
* `-n` 取消默认输出
* `p` 打印指定的数据 
* `d` 删除指定行
* `q` 退出 `sed` 脚本
#### sed 示例
我们来看看 `sed` 是如何运作的。我们从 `data` 文件开始,其中的字段表示编号、名称、年龄和操作系统。
### sed 示例
我们来看看 sed 是如何运作的。我们从 data 文件开始,其中的字段表示编号,名称,年龄和操作系统。
如果行出现在特定的行范围内,该行将打印 2 次。
如果行出现在特定的行范围内,该行将打印 2 次:
```
$ cat data
@ -250,9 +242,9 @@ $ sed '3,7 p' data
9 Mindy Howard 20 Mac
```
这里的操作用单引号括起来,表示第 3 行和第 7 行,并且使用了 p 打印出符合匹配规则的数据。sed 的默认行为是在解析后打印每一行。这意味着由于使用了 p ,第 3 行到第 7 行打印了两次。
这里的操作用单引号括起来,表示第 3 行和第 7 行,并且使用了 `p` 打印出符合匹配规则的数据。sed 的默认行为是在解析后打印每一行。这意味着由于使用了 `p` ,第 3 行到第 7 行打印了两次。
如何打印文件中特定的行?使用 -n 选项来消除在输出中不匹配的行。
如何打印文件中特定的行?使用 `-n` 选项来消除在输出中不匹配的行:
```
$ sed -n '3,7 p' data
@ -265,7 +257,7 @@ $ sed -n '3,7 p' data
使用 -n 仅仅只有第 3 行到第 7 行会被打印。
省略文件中的特定行。使用 d 从输出中删除行。
省略文件中的特定行。使用 `d` 从输出中删除行:
```
$ sed '3 d' data
@ -285,7 +277,7 @@ $ sed '5,9 d' data
4 Gilberto Mack 30 Windows
```
从文件中搜索特定的关键字
从文件中搜索特定的关键字
```
$ sed -n '/linux/ p' data
@ -298,9 +290,9 @@ $ sed -n '/linux/I p' data
8 Ralph Martin 19 linux
```
在这些例子中,我们在 / / 中使用了一个正则表达式。如果文件中有类似的单词,但大小写不一致,可以使用 “I” 使得搜索不区分大小写。回想一下,‘-n 删除了输出中不匹配的行。
在这些例子中,我们在 `/ /` 中使用了一个正则表达式。如果文件中有类似的单词,但大小写不一致,可以使用 `I` 使得搜索不区分大小写。回想一下,`-n` 删除了输出中不匹配的行。
替换文件中的单词
替换文件中的单词
```
$ sed 's/linux/linus/' data
@ -315,28 +307,26 @@ $ sed 's/linux/linus/' data
9 Mindy Howard 20 Mac
```
这里 s/ / / 表示它是一个正则表达式。在两个 / 之间的就是定位的单词和需要替换的新单词。
这里 `s/ / /` 表示它是一个正则表达式。在两个 `/` 之间的就是定位的单词和需要替换的新单词。
## **tr**
### tr
tr 命令可以用来转换或删除字符。它可以将小写字母转换为大写字母,也可以将大写字母转换为小写字母,可以消除重复字符,也可以删除特定字符。
`tr` 命令可以用来转换或删除字符。它可以将小写字母转换为大写字母,也可以将大写字母转换为小写字母,可以消除重复字符,也可以删除特定字符。
tr 的奇怪之处在于,它不同于 wc, sort, sed 那样接受文件作为输入。我们使用 “|” (管道符)为 tr 命令提供输入。
`tr` 的奇怪之处在于,它不同于 `wc`、`sort`、`sed` 那样接受文件作为输入。我们使用 `|` (管道符)为 `tr` 命令提供输入。
```
$ cat filename | tr [OPTION]
```
tr 命令使用的一些选项:
`tr` 命令使用的一些选项:
* -d : 删除给定输入第一个集合中的指定字符,不做转换
* -s : 将重复出现的字符替换为单个
* `-d` 删除给定输入第一个集合中的指定字符,不做转换
* `-s` 将重复出现的字符替换为单个
#### tr 示例
### tr 示例
现在让我们使用 tr 命令将 letter 文件中的所有小写字符转换为大写字符。
现在让我们使用 `tr` 命令将 `letter` 文件中的所有小写字符转换为大写字符:
```
$ cat letter
@ -348,9 +338,9 @@ LINUX IS TOO EASY TO LEARN,
AND YOU SHOULD TRY IT TOO.
```
这里的 a-z A-Z 表示我们想要将 “a” 到 “z” 范围内的小写字符转换为大写字符。
这里的 `a-z`、`A-Z` 表示我们想要将 `a``z` 范围内的小写字符转换为大写字符。
删除文件中的 “o” 字符。
删除文件中的 `o` 字符:
```
$ cat letter | tr -d 'o'
@ -358,7 +348,7 @@ Linux is t easy t learn,
And yu shuld try it t.
```
从文件中压缩字符 “o” 意味着如果 “o” 在文件中重复出现,那么它将会被删除并且只打印一次。
从文件中压缩字符 `o` 意味着如果 `o` 在文件中重复出现,那么它将会被删除并且只打印一次:
```
$ cat letter | tr -s 'o'
@ -366,9 +356,9 @@ Linux is to easy to learn,
And you should try it to.
```
## **结论**
### 总结
这是使用 wc, sort, sed, tr 命令的快速演示。这些命令可以方便快捷的操作终端上的文本文件。你可以使用 man 命令来了解这些命令的更多信息。
这是使用 `wc`、`sort`、`sed`、`tr` 命令的快速演示。这些命令可以方便快捷的操作终端上的文本文件。你可以使用 `man` 命令来了解这些命令的更多信息。
--------------------------------------------------------------------------------
@ -377,7 +367,7 @@ via: https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/
作者:[mahesh1b][a]
选题:[lujun9972][b]
译者:[perfiffer](https://github.com/perfiffer)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,80 @@
[#]: subject: (How to Install elementary Tweaks Tool)
[#]: via: (https://www.debugpoint.com/2021/07/elementary-tweaks-install/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (imgradeone)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13665-1.html)
如何安装 elementary 优化工具
======
> 这篇快速教程演示了如何安装 elementary / Pantheon 优化工具。
![](https://img.linux.net.cn/data/attachment/album/202108/10/092914jj9gzejjglclu160.jpg)
<ruby>elementary 优化工具<rt>elementary Tweaks Tool</rt></ruby>是专为 [elementary OS][1] 设计的实用工具。它提供了一些用于修改 elementary 设置的选项。虽然 elementary 已经提供了绝大多数选项,但还有一小部分的 Pantheon 桌面优化是不能直接通过普通设置修改的,因此这个工具才得以诞生。这个工具与 GNOME 中的 [GNOME Tweaks][2] 有些相似。
也就是说,安装这个工具其实十分简单,只是 [elementary OS 6 Odin][3] 与早期版本(例如 elementary OS 5 Juno存在一些区别。从 elementary OS 6 Odin 开始,这个工具已经重命名为 <ruby>Pantheon 优化工具<rt>Pantheon Tweaks Tool</rt></ruby>。下面是安装步骤。
### 安装 elementary 优化工具
elementary OS 并没有内置用于添加 PPA 的 `software-properties-common` 软件包。如果你还没有安装此软件包,请使用如下命令安装:
```
sudo apt install software-properties-common
```
#### elementary OS 6 Odin
该版本的优化工具已经改名,并且独立于原版开发。它的名称是 [Pantheon Tweaks][4]。你可以使用如下命令安装它。
```
sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks
sudo apt install -y pantheon-tweaks
```
#### elementary OS 5 Juno 及更旧版本
如果你正在使用 elementary OS 5 Juno 或者更旧的版本,你可以使用同一 PPA 安装早期版本的 [elementary-tweaks][5]。在终端输入以下命令即可安装。
```
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks
sudo apt install -y elementary-tweaks
```
### 使用方法
安装完成后,你可以在 “应用程序菜单 > 系统设置 > 优化” 中使用此工具。
![设置中的 Tweaks优化选项][6]
在“优化”窗口,你可以修改一些选项,配置你的 elementary 桌面。
![安装完成后的 elementary 优化工具 —— 选项][7]
顺便提示一下,这款工具仅仅是 elementary 桌面设置的前端。如果你知道准确的名称或属性,你可以直接在终端中修改配置。你在这款优化工具中获得的选项也可以在 `dconf` 编辑器中查找 `io.elementary` 路径以修改。
如果你在安装或使用优化工具时遇到了一些问题,你可以在评论区留言。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/elementary-tweaks-install/
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[imgradeone](https://github.com/imgradeone)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/tag/elementary
[2]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
[3]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/
[4]: https://github.com/pantheon-tweaks/pantheon-tweaks
[5]: https://github.com/elementary-tweaks/elementary-tweaks
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/tweak-in-settings.png
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/elementary-tweaks-after-install-options.png

View File

@ -3,18 +3,20 @@
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13669-1.html)
使用 Linux 终端查看你的电脑上有哪些文件
======
通过这个 Linux 教程学习如何使用 ls 命令在终端中列出文件。
![List files on your computer][1]
要在有图形界面的计算机上列出文件你通常可以打开一个文件管理器Linux 上的 **Files**MacOS 上的 **访达**Windows 上的 **文件资源管理器**)来查看文件。
> 通过这个 Linux 教程学习如何使用 ls 命令在终端中列出文件。
要在终端中列出文件,你可以使用 **ls** 命令来列出当前目录中的所有文件。而 **pwd** 命令可以告诉你当前所在的目录。
![](https://img.linux.net.cn/data/attachment/album/202108/11/142450etebpqtp7bl4kupt.jpg)
要在有图形界面的计算机上列出文件你通常可以打开一个文件管理器Linux 上的 “文件”MacOS 上的 “访达”Windows 上的 “文件资源管理器”)来查看文件。
要在终端中列出文件,你可以使用 `ls` 命令来列出当前目录中的所有文件。而 `pwd` 命令可以告诉你当前所在的目录:
```
$ pwd
@ -29,7 +31,7 @@ Templates
Videos
```
你可以通过 **\--all** 选项看到隐藏文件。
你可以通过 `--all`(简写为 `-a` 选项看到隐藏文件:
```
$ pwd
@ -43,11 +45,11 @@ example.txt     Templates
Documents       Videos
```
如你所见,列出的前两项是点。单个点实际上是一个元位置,代表 _你当前所在的文件夹_ 。两个点表示你可以从当前位置返回的上级目录。也就是说,当前目录在另一个文件夹中。当你在计算机目录间移动时,你就可以利用这些元位置为自己创建快捷方式,或者增加你的路径的独特性。
如你所见,列出的前两项是点。单个点`.`实际上是一个元位置,代表 _你当前所在的文件夹_ 。两个点`..`表示你可以从当前位置返回的上级目录。也就是说,当前目录在另一个文件夹中。当你在计算机目录间移动时,你就可以利用这些元位置为自己创建快捷方式,或者增加你的路径的独特性。
### 文件和文件夹以及如何区分它们
你可能会注意到,文件和文件夹是很难区分的。一些 Linux 发行版有一些漂亮的颜色设置,比如所有的文件夹都是蓝色的,文件是白色的,二进制文件是粉色或绿色的,等等。如果你没有看到这些颜色,你可以试试 **ls --color**。如果你有色盲症或者使用的不是彩色显示器,你可以使用 **\--classify** 选项替代:
你可能会注意到,文件和文件夹是很难区分的。一些 Linux 发行版有一些漂亮的颜色设置,比如所有的文件夹都是蓝色的,文件是白色的,二进制文件是粉色或绿色的,等等。如果你没有看到这些颜色,你可以试试 `ls --color`。如果你有色盲症或者使用的不是彩色显示器,你可以使用 `--classify` 选项替代:
```
$ pwd
@ -67,7 +69,7 @@ via: https://opensource.com/article/21/8/linux-list-files
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -24,7 +24,7 @@ Mozilla 的 Firefox 是基于 Chromium 内核的浏览器的唯一流行替代
不过,我在 Reddit 上偶然发现了由 [u/nixcraft][1] 写的一篇帖子,这篇帖子强调了 Firefox 的用户数从 2018 年来不断下降的原因。
而令人惊讶的是,这篇帖子的原始信息来源就是 [Firefox 的公数据报表][2]。
而令人惊讶的是,这篇帖子的原始信息来源就是 [Firefox 的公数据报表][2]。
![][3]

View File

@ -3,13 +3,15 @@
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (zpl1025)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13661-1.html)
如何在 Linux 系统里查找并删除重复相片
======
![](https://img.linux.net.cn/data/attachment/album/202108/09/101511dq8uo51o8go5s9n9.jpg)
点击打开了很多相似的相片?同样的相片保存在不同文件夹里?我理解这种感受。
在相机里点击相片,通过 WhatsApp 发送。然后又备份相片,于是在 WhatsApp 和系统相册里就会存下同样的拷贝。这个很烦人,很乱而且额外占用不必要的存储空间。
@ -18,7 +20,7 @@
### 使用 digiKam 来找出和删除重复相片
[digiKam][1] 是一个免费的[用来管理和收集相片的开源应用][2]。它主要是方便摄影师,但并不是说一定要专业玩相机的人才能用。
[digiKam][1] 是一个 [用来管理和收集相片的自由开源应用][2]。它主要是方便摄影师,但并不是说一定要专业玩相机的人才能用。
我可以演示如何使用这个工具来查找重复相片,然后根据需要删除重复内容。
@ -40,7 +42,7 @@
#### 第三步
在相片导入完成以后,在文件菜单里选择**工具-&gt;查找重复图片**。
在相片导入完成以后,在文件菜单里选择**工具->查找重复图片**。
![在文件菜单里,选择工具->查找重复图片][7]
@ -50,9 +52,9 @@
![digiKam 找到的重复图片][8]
在上面的截图里,我在左侧选中的图片有四张一样的。其中有一张图片标记了‘参考图片’,不过还是由你来确定哪张是原始的,哪张是复制的。
在上面的截图里,我在左侧选中的图片有四张一样的。其中有一张图片标记了<ruby>参考图片<rt>Reference image</rt></ruby>,不过还是由你来确定哪张是原始的,哪张是复制的。
重复的相片默认会按保存位置(比如文件夹)来分组。可以在文件菜单里选择**视图-&gt;分类显示**选择其他方式。
重复的相片默认会按保存位置(比如文件夹)来分组。可以在文件菜单里选择**视图->分类显示**选择其他方式。
**要删除重复相片的话**,选中有侧边栏里的相片并按下删除键。
@ -62,7 +64,7 @@
如果想一次把所有重复相片全删掉的话,可以在左侧边栏里选中所有相片。
然后,打开**文件菜单-&gt;视图-&gt;排序**,然后选择按相似程度。
然后,打开**文件菜单->视图->排序**,然后选择按相似程度。
![删除多个重复相片][9]
@ -70,13 +72,13 @@
#### 额外提示:可以在垃圾桶里恢复已删除的相片
意外总是有的。人们经常会不小心误删了相片。这也是为什么 digiKam 不会立刻彻底删除图片。而是选择在保存相片的文件夹下创建隐藏的 .dtrash 文件夹,然后将‘已删除’的相片移动到里面。
意外总是有的。人们经常会不小心误删了相片。这也是为什么 digiKam 不会立刻彻底删除图片。而是选择在保存相片的文件夹下创建隐藏的 `.dtrash` 文件夹,然后将“已删除”的相片移动到里面。
在应用程序界面上,你也可以看到这个垃圾桶文件夹。在里面可以找到你‘删除’的相片,然后根据需要可以选择恢复。
在应用程序界面上,你也可以看到这个垃圾桶文件夹。在里面可以找到你“删除”的相片,然后根据需要可以选择恢复。
![digiKam 的垃圾桶文件夹][10]
希望你能喜欢这个关于在 Linux 上查找和删除重复图片的简短教程。类似的,你可能会想了解[使用 GUI 工具在 Linux 系统里搜索重复文件][11]。
希望你能喜欢这个关于在 Linux 上查找和删除重复图片的简短教程。类似的,你可能会想了解 [使用 GUI 工具在 Linux 系统里搜索重复文件][11]。
有任何问题和建议,请在下方留评。
@ -87,7 +89,7 @@ via: https://itsfoss.com/find-remove-duplicate-photos-linux/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[zpl1025](https://github.com/zpl1025)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,73 @@
[#]: subject: "Its Time for Ubuntu to Opt for a Hybrid Rolling Release Model"
[#]: via: "https://news.itsfoss.com/ubuntu-hybrid-release-model/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13666-1.html"
是时候让 Ubuntu 选择混合滚动发布模式了
======
> 在两个 LTS 版本之间有三个短期版本。Ubuntu 应该用滚动发布模式来取代它们。
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/Ubuntu-hybrid-release-model.jpg?w=1200&ssl=1)
即使你不是 Ubuntu 的用户,你可能也知道它的发布模式。
有一个 [长期支持LTS版本][1],每两年发布一次,并有五年的支持。在这两个 LTS 版本之间,我们可以看到三个非 LTS 版本,它们的发布时间间隔为 6 个月。
LTS 版本会保持内核不会变化(除非你选择 [HWE 内核][2]),它还维持了各种软件组件不变以提供稳定的生产环境。
介于两者之间的非 LTS 版 Ubuntu 具有 Ubuntu 的新功能、更新一些的内核、新的桌面环境以及 Ubuntu 软件库中的各种软件的新版本。
这些非 LTS 版本作为“试验场”,为最终在 LTS 版本中出现的功能提供测试,这已不是什么秘密。
这就是为什么我建议摆脱这些中间版本,在 LTS 版本之间选择 [滚动发布][3] 模式。个中原因,请听我说。
### 在 LTS 发布之间进行滚动开发
六个月一次的发布计划给 Ubuntu 开发者制定了一个紧凑的工作时间表。这是一个好的方法,它可以使他们的目标集中在一个适当的路线图上。
但是,这也为在每个版本中提供“更多”新功能带来了额外的压力。如果时间很短,这不可能总是做到。还记得 [Ubuntu 不得不从 21.04 版本中删除 GNOME 40][4] 吗?因为开发者没有足够的时间来完成它。
另外,最终用户(比如你和我)想选择留在非 LTS 版本中也是不可行的。其支持在九个月后结束,这意味着即使你没有立即升级到下一个非 LTS 的 Ubuntu 版本,最终你也不得不这样做。如果你在 6 个月内没升级,那你可能就得在 9 个月内升级。
我知道你会说,升级 Ubuntu 版本很简单。点击几下,良好的网速和一个潜在的备份就可以让你在新的 Ubuntu 版本上没有什么麻烦。
我的问题是,为什么要这么麻烦。滚动发布会更简单。让升级在 LTS 版本之间进行。
开发人员在新功能准备好的时候发布。用户随着系统更新不断得到升级,而不是每 6 个月或 9 个月做一次“重大升级”。
你看,那些选择非 LTS 版本的人是那些想要新功能的人让他们通过滚动发布获得新功能。LTS 的发布时间表保持不变,每两年来一次。
### Bug 测试?像其他滚动发布的版本一样做个测试分支好了
当我说滚动发布时,我并不是指像 Arch Linux 那样的滚动。它应该是像 Manjaro 那样的滚动。换句话说,在测试后推出升级版,而不是直接在野外发布。
目前,新的 Ubuntu 版本有测试版,以便早期采用者可以测试它并向开发者提供反馈。这可以通过保留测试和稳定分支来实现,就像许多其他滚动发布的版本一样。
### 你对滚动发布怎么看?
我知道 Ubuntu 的铁杆用户期待着每一次的发布。代号、吉祥物、艺术品和墙纸,这些都是 Ubuntu 的传统的一部分。我们应该打破这种传统吗?
这只是我的看法我很想听听你的看法。Ubuntu 应该选择这种混合滚动模式还是坚持目前的模式?你怎么看呢?
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-hybrid-release-model/
作者:[Abhishek][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/long-term-support-lts/
[2]: https://itsfoss.com/ubuntu-hwe-kernel/
[3]: https://itsfoss.com/rolling-release/
[4]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/

View File

@ -0,0 +1,104 @@
[#]: subject: "The Wait is Over! elementary OS 6 Odin is Finally Here With Exciting Changes"
[#]: via: "https://news.itsfoss.com/elementary-os-6-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "imgradeone"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13670-1.html"
久等了elementary OS 6 “Odin” 正式发布,带来令人激动的新变化
======
> 基于 Ubuntu 20.04 LTS备受期待的 elementary OS 6 终于可以下载了。
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/elementary-os-6-release.jpg?w=1200&ssl=1)
[2021 年最值得期待的 Linux 发行版][1] 之一,终于来了。
elementary OS 6 基于 Ubuntu 20.04 LTS它大幅改进了用户体验和安全性。
虽然我们已经列出了 [elementary OS 6 的新功能列表][2],但咱们还是来看看本次更新的主要亮点吧。
### 正式引入暗黑模式
![][3]
elementary OS 6 加入这个功能可能为时太晚,但至少他们做了极大的努力,让整个系统拥有一致的暗黑模式体验。
你也会注意到,预装应用和应用中心里部分适配过的应用都支持暗黑模式。
暗黑模式在安装 elementary OS 6 后也可以直接在欢迎页设置。
### 通知优化
![][4]
通知现在支持操作按钮和图标徽章,视觉更舒适,也更加易用。
### Flatpak 优先原则
![][5]
为了加强隐私保护和安全性elementary OS 6 提供了开箱即用的 Flatpak 应用支持。
现在,不仅仅是系统应用,在应用中心,所有应用都已经打包为 Flatpak 格式。
### 多点触控手势
![][6]
对于触控板和触摸屏用户elementary OS 6 带来了不错的手势交互,你完全可以借助手势来穿梭于系统中。
你甚至可以通过手势来忽略通知。
### 新应用,新更新
本次更新中,待办事项和固件更新正式加入预装应用。
同时,大部分系统应用(如邮件)也重构了 UI以及获得了一些新功能。
### 其他重要改进
![][7]
如果你想了解更多关于本次更新的内容,我强烈建议你试用 elementary OS 6 来自行探索。
当然,如果你现在就想速览其他重要的新功能,那么我列出几个:
* 在安装应用中心之外的第三方应用时会有警告。
* 在向终端粘贴需要 root 权限的命令时会有警告。
* 更便于区分多任务视图中活动窗口的细节变化。
* 系统设置内置了在线账户集成。
* 辅助功能优化。
* 全新壁纸。
* 改进的安装器。
### 下载 elementary OS 6
你现在可以从 elementary OS 的官网获取 elementary OS 的最新版本。如需了解详情,你也可以查阅 [官方公告][8]。
- [下载 elementary OS 6][9]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/elementary-os-6-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[imgradeone](https://github.com/imgradeone)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/linux-distros-for-2021/
[2]: https://news.itsfoss.com/elementary-os-6-features/
[3]: https://news.itsfoss.com/wp-content/uploads/2021/08/onboarding-dark.png
[4]: https://news.itsfoss.com/wp-content/uploads/2021/06/notification-badge-elementary-os-6.png
[5]: https://news.itsfoss.com/wp-content/uploads/2021/08/appcenter.png
[6]: https://news.itsfoss.com/wp-content/uploads/2021/08/multitouch-multitasking.png
[7]: https://news.itsfoss.com/wp-content/uploads/2021/08/elementary-os-6-terminal-paste-protection.png
[8]: https://blog.elementary.io/elementary-os-6-odin-released/
[9]: https://elementary.io

View File

@ -2,7 +2,7 @@
[#]: via: (https://news.itsfoss.com/kde-connect-windows/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (imgradeone)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,75 +0,0 @@
[#]: subject: "Its Time for Ubuntu to Opt for a Hybrid Rolling Release Model"
[#]: via: "https://news.itsfoss.com/ubuntu-hybrid-release-model/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Its Time for Ubuntu to Opt for a Hybrid Rolling Release Model
======
Even if you are not an Ubuntu user, you probably are aware of its release model.
There is a [long term support (LTS) release][1] that comes every two year and gets supported for five years. In between the two LTS releases, we see three non-LTS releases that are released at an interval of six months.
The LTS version retains the same kernel (unless you opt for [HWE kernel][2]) and it also holds on to various software components to provide a stable production environment.
The non-LTS Ubuntu releases that come in between feature new features from Ubuntu, newer kernel, new desktop environment and newer version of various software available from Ubuntu repositories.
It is no secret that these non-LTS releases work as a testing ground for the features that would eventually land in the LTS release.
And this is why I suggest to get rid of these intermediate releases and opt for a [rolling release][3] model between the LTS releases. Here me out, please.
### Go rolling in-between the LTS releases
The six monthly release schedule gives the Ubuntu developers a tight schedule to work on. Its good in the way that keeps their objective in focus with a proper roadmap.
But it also builds additional pressure to deliver more new features in every release. That cannot always happen if the timeframe is short. Remember how [Ubuntu had to drop GNOME 40 from 21.04][4] because the developers didnt get enough time to work on it?
Also, its not that the end user (like you and me) gets a choice to stay with a non-LTS release. The support ends in nine months, which mean that even if you did not upgrade to the next non-LTS Ubuntu version immediately, you have to do it eventually. If it does not happen in six months, it has to in nine months.
I know you would say that upgrading Ubuntu version is simple. A few clicks, good internet speed and a potential backup will put you on the new Ubuntu version without much trouble.
And my questions is, why bother with that. A rolling release will be even simpler. Let the upgrades come between the LTS releases.
Developers release the new features when it is ready. Users get the upgrades with the system updates continually, instead of doing a major upgrade every six or nine months.
See, the people who opt for non-LTS release are the ones who want new features. Let them get the new features through rolling releases. The LTS release schedule remains the same, coming every two years.
#### Bug testing? Get a testing branch like other rolling releases
When I say rolling, I do not mean rolling like Arch Linux. It should be rolling like Manjaro. In other words, roll out the upgrades after testing rather than just releasing them in the wild.
At present, the new Ubuntu versions have beta releases so that early adopters can test it and provide feedback to the developers. This can be achieved by keeping testing and stable branches, like many other rolling release distributions.
### Rolling release or not? What do you think?
I know that hardcore Ubuntu users look forward to every single release. The code name, the mascot, the artwork and the wallpapers, these are all part of Ubuntus legacy. Should we break with this legacy?
Its just my opinion and I am interested to hear yours. Should Ubuntu opt for this hybrid rolling model or stick with the current one? What do you think?
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-hybrid-release-model/
作者:[Abhishek][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://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/long-term-support-lts/
[2]: https://itsfoss.com/ubuntu-hwe-kernel/
[3]: https://itsfoss.com/rolling-release/
[4]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/

View File

@ -0,0 +1,198 @@
[#]: subject: "Top 11 New Features in elementary OS 6 Linux Release"
[#]: via: "https://news.itsfoss.com/elementary-os-6-features/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Top 11 New Features in elementary OS 6 Linux Release
======
elementary OS 6 is a major upgrade after a few good years of updates to the 5.x series.
While the 5.x series has had numerous feature updates and improvements, [elementary OS 6][1] looks to be an exciting endeavor.
Here, we shall take a look at all the new features and additions that have been introduced with elementary OS 6.
### 1\. Dark Style &amp; Accent Color
![][2]
[elementary OS][3] approaches the dark style theme similar to how mainstream options work, as an opt-in preference. You get to choose it from the Welcome screen right after you install elementary OS 6.
While the addition of a dark mode may sound like something minor, they seem to have put a great deal of effort to provide a consistent dark mode experience overall.
All the first-party applications seamlessly support both the dark style and light theme.
elementary OS will also let the app developers respect the users preference in elementary OS 6. So, if the user prefers a dark mode or light mode, the app can adapt to that.
Along with new accent colors available, there is an automatic accent color preference that picks the color from your current wallpaper.
### 2\. Improved Notifications &amp; Redesigned Notification Center
The notifications now support icon badges and action buttons, which should make up for a better experience.
![][4]
This could let you quickly open links, mark a message read, along with several other possibilities.
Urgent notifications have a new look and a unique sound to help you identify them.
In addition to the notification improvements, the notification center has also been revamped to look better and clean with multiple notifications.
### 3\. Online Accounts
Finally, with elementary OS 6, you will be able to add online accounts from the system settings.
Once signed in, your data will sync across the system apps wherever supported (like Calendar, Tasks).
It should also show up in the system tray notifications.
### 4\. First-Party Flatpak Apps &amp; Permissions View
To improve privacy and security across the platform, elementary OS 6 chose the Flatpak-first approach.
elementary OS now has its own AppCenter Flatpak repository. Some of the default applications come baked in as Flatpak packages and all the applications listed in AppCenter are available as Flatpaks as well.
Overall, this means a better sandboxing experience where all of your applications will stay isolated from each other without accessing your sensitive data.
![][5]
And, to top it all off, elementary OS 6 adds “Portals” where the applications will request permission to access your files or launch another application.
You also get to control all the permissions from the System Settings.
### 5\. Multi-Touch Gestures
![][6]
For Laptop and touchpad users, the new multi-touch gestures are going to come in extremely handy.
From accessing the multitasking view to navigating through the workspaces, you can do it all using multi-touch gestures.
Not just limited to certain functions on the desktop, you can interact with notifications, swipe through applications, and can have a seamless system-wide experience with the new multi-touch gestures.
You can customize the gestures or learn more about it from the Gestures section under the System Settings.
### 6\. Screen Shield
With elementary OS 5, some noticed an issue with automatic screen locking when you want to run a time-consuming task or simply watch videos.
However, this changes with elementary OS 6, not only it solves the issue, it brings in a new implementation in the form of “**Screen Shield**” feature.
So, you can easily keep your system awake without sudden disruptions when watching a video or performing a time-consuming task.
It utilizes GNOMEs daemon settings to have better compatibility with third-party applications.
### 7\. New Tasks App
![][7]
A new tasks app has been added in elementary OS 6 where you can manage tasks, get reminded of them, and organize them on your system or synchronize it with an online account.
I may not replace it with Planner just yet, but it is a good addition to have baked in.
### 8\. Firmware Updates App
![][5]
You can get the latest firmware updates for supported devices without fiddling with any other settings.
Just look for the “Firmware” application from the menu to get started.
### 9\. App Updates
Several applications have been updated while introducing new capabilities.
For instance, Epiphany browser was renamed to “Web” and is now available as a Flatpak to facilitate quick updates.
It also includes tracking protection and ad blocking built-in.
Some other notable changes include:
* The camera app has recieved a new UI overhaul with the ability to switch cameras, mirroring of image, and more.
* AppCenter not just lists Flatpak apps now but also notifies you when an application has completed installation to let you quickly open it.
* Files app has also received improvements in the form a new sidebar and list view. Also, a double-click is now required to open a file and a single click can navigate through folders.
Other applications like Mail, Calendar have also received improvements for better online integrations.
### 10\. Improved Desktop Workflow &amp; Screenshot Utility
![][8]
The multitasking view now helps you clearly distinguish among multiple active windows. And the hot corners view lets you move the window to a new workspace and maximize the window as well.
![][9]
The screenshot utility can be moved around in the window, not just stuck to the center of the window. You can also drag and drop the image from the preview without needing to save it.
### 11\. Improved Installer
![][10]
You will notice some new subtle animations, and some efforts have been made to provide a consistent layout of the installer without re-sizing the window.
![][11]
![][11]
![][12]
![][12]
![][12]
![][13]
![][13]
![][12]
![][12]
It isnt a major overhaul, but they mention that the new installer comes with an improved disk detection and error handling, which should make the installation seamless.
### Wrapping Up
[elementary OS 6][3] is an exciting release with several improvements. Even though the look and feel is not entirely different, it has been polished across the board.
I like what they are doing to provide a consistent and beautiful user experience. Also, changes like system-wide Flatpak should make things easier and safer for users.
What do you think about this release? Have you tried it yet?
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/elementary-os-6-features/
作者:[Ankush Das][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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/elementary-os-6-release/
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://elementary.io
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4MCIgd2lkdGg9IjcyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgxNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY5MiIgd2lkdGg9IjY2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=

View File

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

View File

@ -1,123 +0,0 @@
[#]: subject: (3 essential Linux cheat sheets for productivity)
[#]: via: (https://opensource.com/article/21/4/linux-cheat-sheets)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (YungeG)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
3 essential Linux cheat sheets for productivity
======
Download cheat sheets for sed, grep, and parted to integrate new
processes into your work.
![Hand putting a Linux file folder into a drawer][1]
Linux is famous for its commands. This is partially because nearly everything that Linux does can also be invoked from a terminal, but it's also that Linux as an operating system is highly modular. Its tools are designed to produce fairly specific results, and when you know a lot about a few commands, you can combine them in interesting ways for useful output. Learning Linux is equal parts learning commands and learning how to string those commands together in interesting combinations.
With so many Linux commands to learn, though, taking the first step can seem daunting. What command should you learn first? Which commands should you learn well, and which commands require only a passing familiarity? I've thought about these questions a lot, and I'm not convinced there's a universal answer. The "basic" commands are probably the same for anyone:
* `ls`
* `cd`
* `mv`
These amount to being able to navigate your Linux file system.
Beyond the basics, though, the "default" commands vary from industry to industry. Sysadmins need tools for [system introspection and monitoring][2]. Artists need tools for [media conversion][3] and [graphic processing][4]. Home users might want tools for [PDF processing][5], or [calendaring][6], or [document conversion][7]. The list goes on and on.
However, some Linux commands stand out as being particularly important—either because they're common low-level tools that everyone needs on occasion or they're all-purpose tools that anyone might find useful most of the time.
Here are three to add to your list.
### Sed
**Purpose:** The `sed` command is a good, all-purpose tool that any Linux user can benefit from knowing. On the surface, it's just a terminal-based "find and replace." That makes it great for quick and easy corrections across multiple documents. The `sed` command has saved me hours (or possibly cumulative days) of opening individual files, searching and replacing a word, saving the file, and closing the file. It alone justifies my investment in learning the Linux terminal. Once you get to know `sed` well, you're likely to discover a whole world of potential editing tricks that make your life easier.
**Strength:** The command's strength is in repetition. If you have just one file to edit, it's easy to open it and do a "find and replace" in a traditional [text editor][8]. However, when you're faced with five or 50 files, a good `sed` command (maybe combined with [GNU Parallel][9] for extra speed) can reclaim hours of your day.
**Weakness:** You have to balance the time you expect to spend making a change with how long it may take you to construct the right `sed` command. Simple edits with the common `sed 's/foo/bar/g` syntax are almost always worth the trivial amount of time it takes to type the command, but complex `sed` commands that utilize a hold space and any of the `ed` style subcommands can take serious concentration combined with several rounds of trial and error. It can be, as it turns out, better to do some edits the new-fashioned way.
**Cheat:** Download our [sed cheat sheet][10] for quick reference to its single-letter subcommands and an overview of its syntax.
### Grep
**Purpose:** The `grep` command comes from its admittedly clunky description: global regular expression print. In other words, `grep` prints to the terminal any matching pattern it finds in files (or other forms of input). That makes it a great search tool, especially adept at scrubbing through vast amounts of text.
You might use it to find URLs:
```
$ grep --only-matching \
http\:\/\/.* example.txt
```
You could use it to find a specific config option:
```
$ grep --line-number \
foo= example.ini
2:foo=true
```
And of course, you can combine it with other commands:
```
$ grep foo= example.ini | cut -d= -f2
true
```
**Strength:** The `grep` command is a straightforward search command. If you've read the few examples above, then you've essentially learned the command. For even more flexibility, you can use its extended regular expression syntax.
**Weakness:** The problem with `grep` is also one of its strengths: It's just a search function. Once you've found what you're looking for, you might be faced with the larger question of what to do with it. Sometimes the answer is as easy as redirecting the output to a file, which becomes your filtered list of results. However, more complex use cases mean further processing with any number of commands like [awk][11], [curl][12] (incidentally, [we have a cheat sheet for curl][13], too), or any of the thousands of other options you have on a modern computer.
**Cheat:** Download our [grep cheat sheet][14] for a quick reference to its many options and regex syntax.
### Parted
**Purpose:** GNU `parted` isn't a daily-use command for most people, but it is one of the most powerful tools for hard-drive manipulation. The frustrating thing about hard drives is that you spend years ignoring them until you get a new one and have to set it up for your computer. It's only then that you remember that you have no idea how to best format your drive. That's when familiarity with `parted` can be useful. GNU `parted` can create disk labels and create, back up, and rescue partitions. In addition, it can provide you with lots of information about a drive and its layout and generally prepare a drive for a filesystem.
**Strength:** The reason I love `parted` over `fdisk` and similar tools is for its combination of an easy interactive mode and its fully noninteractive option. Regardless of how you choose to use `parted`, its commands follow a consistent syntax, and its help menus are well-written and informative. Better still, the command itself is _smart_. When partitioning a drive, you can specify sizes in anything from sectors to percentages, and `parted` does its best to figure out the finer points of partition table placement.
**Weakness:** It took me a long while to learn GNU `parted` after switching to Linux because, for a very long time, I didn't have a good understanding of how drives actually work. GNU `parted` and most terminal-based drive utilities assume you know what a partition is, that drives have sectors and need disk labels and partition tables that initially lack filesystems, and so on. There's a steep learning curve—not to the command so much as to the foundations of hard-drive technology, and GNU `parted` doesn't do much to bridge the potential gap. It's arguably not the command's job to step you through the process because there are [graphical applications][15] for that, but a workflow-focused option for GNU `parted` could be an interesting addition to the utility.
**Cheat:** Download our [parted cheat sheet][16] for a quick reference to its many subcommands and options.
### Learn more
These are some of my favorite commands, but the list is naturally biased to how I use my computer. I do a lot of shell scripting, so I make heavy use of `grep` to find configuration options, I use `sed` for text editing, and I use `parted` because when I'm working on multimedia projects, there are usually a lot of hard drives involved. You either already have, or you'll soon develop, your own workflows with your own favorite (or at least _frequent_) commands.
When I'm integrating new processes into my daily work, I create or download a cheat sheet (like the ones linked above), and then I practice. We all learn in our own way, though, so find what works best for you, and learn a new essential command. The more you learn about your most frequent commands, the more you can make them work harder for you.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/4/linux-cheat-sheets
作者:[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
[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]: https://opensource.com/life/16/2/open-source-tools-system-monitoring
[3]: https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats
[4]: https://opensource.com/article/17/8/imagemagick
[5]: https://opensource.com/article/20/8/reduce-pdf
[6]: https://opensource.com/article/19/4/calendar-git
[7]: https://opensource.com/article/20/5/pandoc-cheat-sheet
[8]: https://opensource.com/article/21/2/open-source-text-editors
[9]: https://opensource.com/article/18/5/gnu-parallel
[10]: https://opensource.com/downloads/sed-cheat-sheet
[11]: https://opensource.com/article/20/9/awk-ebook
[12]: https://www.redhat.com/sysadmin/social-media-curl
[13]: https://opensource.com/article/20/5/curl-cheat-sheet
[14]: https://opensource.com/downloads/grep-cheat-sheet
[15]: https://opensource.com/article/18/11/partition-format-drive-linux#gui
[16]: https://opensource.com/downloads/parted-cheat-sheet

View File

@ -2,7 +2,7 @@
[#]: via: (https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,84 +0,0 @@
[#]: subject: (How to Install elementary Tweaks Tool)
[#]: via: (https://www.debugpoint.com/2021/07/elementary-tweaks-install/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Install elementary Tweaks Tool
======
This quick tutorial demonstrates the steps to install elementary Tweaks
tool/Pantheon Tweaks Tool.
The elementary Tweaks tool is a handy utility specially designed for [elementary OS][1]. It gives you various options to change certain settings for elementary. Although elementary provides most of the settings already, however, few Pantheon desktop tweaks are not available via standard settings. Hence, this tool. This is a similar tool like we have in GNOME called [GNOME Tweaks][2].
That said, installing this tool is straight forward. Although its a bit different in [elementary OS 6 Odin][3] than earlier versions such as elementary OS 5 Juno. From the elementary OS 6 Odin onwards, this tool is renamed as Pantheon Tweaks tool. Heres how to install.
### Install elementary Tweaks Tool
The elementary OS doesnt include the software-properties-common package, which is required for adding a PPA. If it is not install already, use the following command to install.
```
sudo apt install software-properties-common
```
#### elementary OS 6 Odin
The Tweak tool is renamed with a new name and being developed separately. It is called [Pantheon Tweaks][4]. And using the following commands you can install it.
```
sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks
sudo apt install -y pantheon-tweaks
```
#### elementary OS 5 Juno and below
If you are using elementary OS 5 June and below, you can install the earlier [elementary-tweaks][5] using the same PPA. Follow the below commands from terminal.
```
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks
sudo apt install -y elementary-tweaks
```
### Usage
After installation, you can run it via `Application Menu > System Settings > Tweaks`.
![tweak in settings][6]
In the Tweaks window, you can find several options to change and configure your elementary desktop.
![elementary tweaks after install options][7]
For your information, this tool is just a front end to elementary desktop settings. You can very well change them via terminal provided you know the exact name or property. The settings you get in this tool can also be changed via `dconf` editor in `io.elementary` path.
[][8]
SEE ALSO:   elementary OS 5.1 Hera Released. Heres Whats New
Let me know in the comment box below, if you face any trouble installing, or using this tweak tool.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/elementary-tweaks-install/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/tag/elementary
[2]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
[3]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/
[4]: https://github.com/pantheon-tweaks/pantheon-tweaks
[5]: https://github.com/elementary-tweaks/elementary-tweaks
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/tweak-in-settings.png
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/elementary-tweaks-after-install-options.png
[8]: https://www.debugpoint.com/2019/12/elementary-os-hera-released/

View File

@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/8/openvpn-server-linux)
[#]: author: (D. Greg Scott https://opensource.com/users/greg-scott)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (perfiffer)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,54 +0,0 @@
[#]: subject: (Use the Linux terminal to navigate throughout your computer)
[#]: via: (https://opensource.com/article/21/8/navigate-linux-directories)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Use the Linux terminal to navigate throughout your computer
======
Learn to navigate from directory to directory in the Linux terminal.
![Move around your computer][1]
To navigate through the directories of your computer in a graphical interface, you're probably used to opening a window to get "into" your computer, and then double-clicking on a folder, and then on a subfolder, and so on. You may also use arrow buttons or keys to back track.
To navigate through your computer in the terminal, you use the **cd** command. You can use **cd ..** to move one directory _back_, or **cd ./path/to/another/folder** to jump through many folders into a specific location.
The concept of a URL, which you use on the Internet already, is actually pulled directly from [POSIX][2]. When you navigate to a specific page on some website, like `http://www.example.com/tutorials/lesson2.html`, you are actually changing directory to `/var/www/imaginarysite/tutorials/` and opening a file called `lesson2.html`. Of course, you open it in a web browser, which interprets all that weird-looking HTML code into pretty text and pictures. But the idea is exactly the same.
If you think of your computer as the Internet (or the Internet as a computer, more appropriately), then you can understand how to wander through your folders and files. If you start out in your user folder (your home, or `~` for short) then everywhere you want to go is relative to that:
```
$ cd ~/Documents
$ pwd
/home/tux/Documents
$ cd ..
$ pwd
/home/tux
```
This requires some practise, but after a while it becomes far faster than opening and closing windows, clicking on back buttons and folder icons.
### Auto-completion with Tab
The **Tab** key on your keyboard auto-completes names of directories and files you're starting to type. If you're going to **cd** into `~/Documents`, then all you need to type is `cd ~/Doc` and then press **Tab**. Your shell auto-completes `uments`. This isn't just a pleasant convenience, it's also a way to prevent error. If you're pressing **Tab** and nothing's being auto-completed, then probably the file or directory you _think_ is in a location isn't actually there. Even experienced Linux users try to change directory to a place that doesn't exist in their current location, so use **pwd** and **ls** often to confirm you are where you think you are, and that your current directory actually contains the files you think it contains.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/navigate-linux-directories
作者:[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
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01s04.svg_.png?itok=bC8Bcapk (Move around your computer)
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains

View File

@ -1,52 +0,0 @@
[#]: subject: (Move files in the Linux terminal)
[#]: via: (https://opensource.com/article/21/8/move-files-linux)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Move files in the Linux terminal
======
Use the mv command to move a file from one location to another.
![Moving files][1]
To move a file on a computer with a graphical interface, you open the folder where the file is currently located, and then open another window to the folder you want to move the file into. Finally, you drag and drop the file from one to the other.
To move a file in a terminal, you use the ** **mv** command to move a file from one location to another.
```
$ mv example.txt ~/Documents
$ ls ~/Documents
example.txt
```
In this example, you've moved **example.txt** from its current folder into the **Documents** folder.
As long as you know where you want to take a file _from_ and where you want to move it _to_, you can send files from any location to any location, no matter where you are. This can be a serious time saver compared to navigating through all the folders on your computer in a series of windows just to locate a file, and then opening a new window to where you want that file to go, and then dragging that file.
The **mv** command by default does exactly as it's told: it moves a file from one location to another. Should a file with the same name already exist in the destination location, it gets overwritten. To prevent a file from being overwritten without warning, use the **\--interactive** (or **-i** for short) option:
```
$ mv -i example.txt ~/Documents
mv: overwrite '/home/tux/Documents/example.txt'?
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/move-files-linux
作者:[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
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01s05.svg_.png?itok=PgKQEDZ7 (Moving files)

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/7/openvpn-firewall"
[#]: author: "D. Greg Scott https://opensource.com/users/greg-scott"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -2,7 +2,7 @@
[#]: via: "https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,102 +0,0 @@
[#]: subject: "How to Install Java on Fedora Linux"
[#]: via: "https://itsfoss.com/install-java-fedora/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Java on Fedora Linux
======
Love it or hate it, it is difficult to avoid Java.
Java is still a very popular programming language taught in the schools and used in the enterprises.
If you want to use a Java-based tool or program in Java, youll need to have Java on your system.
This becomes confusing because there are so many technical terms around java.
* Java Development Kit (JDK) for creating Java programs
* Java Runtime Environment (JRE) or Java Virtual Machine (JVM) for running Java programs
On top of that, youll come across [OpenJDK][1] and [Oracle Java SE][2]. OpenJDK is what is recommended because it is open source. If you have exclusive need then only you should go for Oracle Java SE.
There is one more thing here. Even OpenJDK has several versions available. At the time of writing this article, Fedora 34 has OpenJDK 1.8, OpenJDK 11 and OpenJDK 16 available.
It is up to you to decide which Java version you want.
### Installing Java on Fedora Linux
First thing first, check if Java is already installed and which version it is. I am not kidding. Fedora usually comes with Java preinstalled.
To check, use the following command:
```
java -version
```
As you can see in the screenshot below, I have Java 11 (OpenJDK 11) installed on my Fedora system.
![Check Java version][3]
Lets say you want to install another version of Java. You may check the available options with the following command:
```
sudo dnf search openjdk
```
The sudo here is not required but it will refresh the metadata for sudo user which will eventually help when you install another version of Java.
The above command will show a huge output with plenty of similar looking packages. You have to focus on the initial few words to understand the different versions available.
![Available Java versions in Fedora][4]
For example, to install Java 8 (OpenJDK 1.8), the package name should be java-1.8.0-openjdk.x86_64 or java-1.8.0-openjdk. Use it to install it:
```
sudo dnf install java-1.8.0-openjdk.x86_64
```
![Install Java Fedora][5]
Thats good. Now you have both Java 11 and Java 8 installed on your system. But how will you use one of them?
#### Switch Java version on Fedora
Your Java version in use remains the same unless you explicitly change it. Use this command to list the installed Java versions on your system:
```
sudo alternatives --config java
```
Youll notice a number before the Java versions. The + sign before the Java versions indicate the current Java version in use.
You can specify the number to switch the Java version. So, in the example below, if I enter 2, it will change the Java version on the system from Java 11 to Java 8.
![Switching between installed Java versions][6]
Thats all you need to do for installing Java on Fedora.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-java-fedora/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://openjdk.java.net/
[2]: https://www.oracle.com/java/technologies/javase-downloads.html
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/check-java-version-fedora.png?resize=800%2C271&ssl=1
[4]: https://itsfoss.com/wp-content/uploads/2021/08/available-java-versions-fedora-800x366.webp
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/install-java-fedora.png?resize=800%2C366&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/switch-java-versions-fedora.png?resize=800%2C513&ssl=1

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/8/remove-files-linux-terminal"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "unigeorge"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -0,0 +1,172 @@
[#]: subject: "stow: Your Package Manager When You Can't Use Your Package Manager"
[#]: via: "https://theartofmachinery.com/2021/08/08/stow_as_package_manager.html"
[#]: author: "Simon Arneaud https://theartofmachinery.com"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
stow: Your Package Manager When You Can't Use Your Package Manager
======
[GNU `stow`][1] is an underrated tool. Generically, it helps maintain a unified tree of files that come from different sources. More concretely, I use a bunch of software (D compilers, various tools) that I install manually instead of through my systems package manager (for various reasons). `stow` makes that maintainable by letting me cleanly add/remove packages and switch between versions. Heres how its done.
### The ~/local/ directory
The idea is simple: you `stow` install all personal software inside a `local/` directory inside your home directory. The resulting directory structure looks the same as if you installed the software normally to the filesystem root, so youll end up with `~/local/bin` and `~/local/lib` directories, etc.
Setting up the `local/` directory for use with `stow` is easy. The main thing you need is a `local/` directory in your home directory, with a `stow/` subdirectory to store package archives:
```
$ mkdir -p ~/local/stow
```
If youre installing programs into your `local/` directory, you probably want to add `local/bin` to your `PATH` so you can easily use programs there like other programs. You can add this to the end of your `~/.profile` file (or whatever init file is used by your shell):
```
PATH="$HOME/local/bin:$PATH"
```
### Downloading and installing tarball packages
I like [`tsv-utils`][2], a handy collection of tools for data analysis on the command line. Its not in the normal package managers I use, but there are pre-compiled tarball archives available. Heres how to use them with `stow`.
First, switch to your `stow` archive directory:
```
$ cd ~/local/stow
```
Then download the tarball and extract it:
```
$ wget https://github.com/eBay/tsv-utils/releases/download/v2.2.0/tsv-utils-v2.2.0_linux-x86_64_ldc2.tar.gz
$ tar xf tsv-utils-v2.2.0_linux-x86_64_ldc2.tar.gz
```
Youll now have a directory containing all the package files:
```
$ tree tsv-utils-v2.2.0_linux-x86_64_ldc2
tsv-utils-v2.2.0_linux-x86_64_ldc2
├── LICENSE.txt
├── ReleasePackageReadme.txt
├── bash_completion
│ └── tsv-utils
├── bin
│ ├── csv2tsv
│ ├── keep-header
│ ├── number-lines
│ ├── tsv-append
│ ├── tsv-filter
│ ├── tsv-join
│ ├── tsv-pretty
│ ├── tsv-sample
│ ├── tsv-select
│ ├── tsv-split
│ ├── tsv-summarize
│ └── tsv-uniq
└── extras
└── scripts
├── tsv-sort
└── tsv-sort-fast
4 directories, 17 files
```
You can delete the `.tar.gz` archive if you want.
Now you can install the package into `local/` with `stow`:
```
$ stow tsv-utils-v2.2.0_linux-x86_64_ldc2
```
That creates a bunch of symbolic links inside the parent directory (`~/local/`) pointing to files and directories inside the package directory (`~/local/stow/tsv-utils-v2.2.0_linux-x86_64_ldc2`).
If youve set your `PATH` (you might need to restart your shell), youll now be able to run `tsv-utils` commands normally:
```
$ tsv-summarize --help
Synopsis: tsv-summarize [options] file [file...]
tsv-summarize runs aggregation operations on fields in tab-separated value
files. Operations can be run against the full input data or grouped by key
fields. Fields can be specified either by field number or field name. Use
'--help-verbose' for more detailed help.
Options:
[*snip*]
```
# Removing and upgrading packages
Okay, `stow`s algorithm for managing symbolic links is neat, but so far theres no practical benefit over extracting the tarball directly into `local/`. `stow` shines when youre maintaining your package collection. For example, if you decide to uninstall `tsv-utils` later, you just need to switch to the archive directory and run `stow` again with the `-D` flag:
```
$ cd ~/local/stow
$ stow -D tsv-utils-v2.2.0_linux-x86_64_ldc2
```
That will cleanly remove `tsv-utils` from the `local/` directory without breaking any other installed packages. Try doing that after extracting the tarball directly to `local/`.
The package directory inside the `stow/` directory will remain, but you can delete that too, if you want, of course.
`stow` doesnt manage versions, so upgrading packages means uninstalling the old package and installing the new package. `stow` detects when packages collide (e.g., they both include a file called `bin/tsv-summarize`), so you can only install one version at a time. However, you can keep as many archive directories as you like in `stow/`, allowing you to easily switch back and forth between versions if you need to.
### Building packages from source
Not all software comes precompiled. Sometimes youre experimenting with your own custom version. If you want to use source packages with `stow`, you just need to figure out how to make the source package install to a directory in your `stow/` directory, instead of your filesystem root.
Suppose I want to install my own version of the [GraphicsMagick][3] image processing tools. This will be a two-stage process. First Ill need to download and extract the source somewhere (I keep a `src/` directory for third-party source code).
```
$ cd ~/src
$ wget -O GraphicsMagick-1.3.36.tar.gz https://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.36/GraphicsMagick-1.3.36.tar.gz/download
$ tar xf GraphicsMagick-1.3.36.tar.gz
$ cd GraphicsMagick-1.3.36
```
GraphicsMagick uses a GNU-style build system using `autotools`. `configure` scripts take a `--prefix` option that sets the installation root.
```
$ ./configure --prefix="$HOME/local/stow/GraphicsMagick-1.3.36"
$ make install
```
The installation step automatically creates the `stow/GraphicsMagick-1.3.36/` directory. Now I just need to install the built package with `stow`.
```
$ cd ~/local/stow
$ stow GraphicsMagick-1.3.36
$ gm version
GraphicsMagick 1.3.36 20201226 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2020 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
[*snip*]
```
### Other uses
This is my personal favourite usage of `stow`, but its just a generic tool for merging multiple filesystem trees in a maintainable way. Some people use it to manage their `/etc/` configuration files, for example. If you try it out, Im sure you can find other use cases.
--------------------------------------------------------------------------------
via: https://theartofmachinery.com/2021/08/08/stow_as_package_manager.html
作者:[Simon Arneaud][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://theartofmachinery.com
[b]: https://github.com/lujun9972
[1]: https://www.gnu.org/software/stow/
[2]: https://github.com/eBay/tsv-utils
[3]: http://www.graphicsmagick.org/

View File

@ -0,0 +1,97 @@
[#]: subject: "How to Enable Minimize, Maximize Window Buttons in elementary OS"
[#]: via: "https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Enable Minimize, Maximize Window Buttons in elementary OS
======
This is how you can enable the Minimize, Maximize window buttons in
elementary OS.
Many people (mostly new users to elementary OS) asks these questions in various forums:
1. How do I enable minimize buttons in elementary OS?
2. How to I enable restore, minimize, maximize?
3. Is it possible to bring back the minimize and maximize buttons?
And they are completely valid questions, and Its okay to ask questions. Right? This guide to help them to get those buttons in elementary OS.
The Pantheon desktop which is used by elementary OS does not come with default standard window buttons. The reason primarily being a different concept of handling user behavior and activities via Dock and Application menu. Arguably, this design or implementation of this behavior mimics macOS.
That said, many users prefers the window buttons because it is a “muscle-memory'” thing and some migrated from other desktop environments, even windows.
Although elementary doesnt provide you this as a default settings, you can still enable it. Heres how.
### Enable minimize maximize Buttons elementary OS
Open a terminal and install the software properties common which is required for adding a PPA. By default, this package is not installed in elementary OS (dont ask me why, seriously?).
```
sudo apt install software-properties-common
```
#### elementary OS 6 Odin
The Tweak tool is renamed with a new name and being developed separately. It is called [Pantheon Tweaks][1]. And using the following commands you can install it.
```
sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks
sudo apt install -y pantheon-tweaks
```
#### elementary OS 5 Juno and below
If you are using elementary OS 5 June and below, you can install the earlier [elementary-tweaks][2] using the same PPA. Follow the below commands from terminal.
```
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks
sudo apt install -y elementary-tweaks
```
#### Change the settings
* After installation, click on the Application at the top bar and open System Settings.
In the **System settings** window, click on **Tweaks** under Personal section.
* In the Tweaks window, go to **Appearance** section.
* Under **Window** Controls, select **Layout: Windows**.
![enable minimize maximize buttons elementary OS][3]
* And you should have the minimized, maximize and close button on the right side of the top window bar.
There are other combinations as well, such as Ubuntu, macOS, etc. You can choose whatever you feel like:
![Other Options of Window buttons in elementary][4]
This step completes the guide. There are other options in gsettings which you may try to use, but the window manager gala recently removed those options. Hence, they may not work at the moment.
I hope this guide helps you to enable minimize maximize buttons elementary OS. Let me know in the comment box below if you need any help.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://github.com/pantheon-tweaks/pantheon-tweaks
[2]: https://github.com/elementary-tweaks/elementary-tweaks
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Other-Options-of-Window-buttons-in-elementary.jpg

View File

@ -0,0 +1,589 @@
[#]: subject: "NMState: A declarative networking config tool"
[#]: via: "https://fedoramagazine.org/nmstate-a-declarative-networking-config-tool/"
[#]: author: "Maurizio Garcia https://fedoramagazine.org/author/malgnuz/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
NMState: A declarative networking config tool
======
![][1]
Comic excerpted from photo by [Bee Felten-Leidel][2] on [Unsplash][3]
This article describes and demonstrates NMState, a network manager that uses a declarative approach to configure hosts. This means you define the desired configuration state through an API and the tool applies the configuration through a provider.
### Configuration approaches: imperative vs declarative
Networking management can be a very complex task depending on the size and diversity of the environment. In the early days of IT, networking management relied on manual procedures performed by network administrators over networking devices. Nowadays, Infrastructure as Code (IaC) allows automation of those tasks in a different way. There are, essentially two approaches: imperative or declarative.
In an imperative approach you define “how” you will arrive at a desired configuration state. The declarative paradigm defines “what” is the desired configuration state, so it does not shape which steps are required nor in which order they must be performed. This approach is currently gathering more adepts and you can find it on most of the management and orchestration tools currently used.
### NMState: a declarative tool
NMState is a network manager that allows you to configure hosts following a declarative approach. It means you define the desired configuration state through a northbound declarative API and this tool applies the configuration through a southbound provider.
Currently the only provider supported by NMState is NetworkManager, which is the main service to address networking capabilities on Fedora Linux. However, the development life cycle of NMState will add other providers gradually.
For further information regarding NMState please visit either its project [site][4] or github [repository][5].
### Installation
NMState is available on Fedora Linux 29+ and requires NetworkManager 1.26 or later installed and running on the system. The following shows the installation on Fedora Linux 34:
```
$ sudo dnf -y install nmstate
output omitted
Installed:
NetworkManager-config-server-1:1.30.4-1.fc34.noarch gobject-introspection-1.68.0-3.fc34.x86_64 nispor-1.0.1-2.fc34.x86_64 nmstate-1.0.3-2.fc34.noarch
python3-gobject-base-3.40.1-1.fc34.x86_64 python3-libnmstate-1.0.3-2.fc34.noarch python3-nispor-1.0.1-2.fc34.noarch python3-varlink-30.3.1-2.fc34.noarch
Complete!
```
At this point you can use _nmstatectl_ as a command line tool for NMState. Please refer to either _nmstatectl help_ or _man nmstatectl_ for further information about this tool.
### Using NMstate
Start by checking the NMState version installed in the system:
```
$ nmstatectl version
1.0.3
```
Check the current configuration of a networking interface, e.g. the _eth0_ configuration:
```
$ nmstatectl show eth0
2021-06-29 10:28:21,530 root DEBUG NetworkManager version 1.30.4
2021-06-29 10:28:21,531 root DEBUG Async action: Retrieve applied config: ethernet eth0 started
2021-06-29 10:28:21,531 root DEBUG Async action: Retrieve applied config: ethernet eth1 started
2021-06-29 10:28:21,532 root DEBUG Async action: Retrieve applied config: ethernet eth0 finished
2021-06-29 10:28:21,533 root DEBUG Async action: Retrieve applied config: ethernet eth1 finished
---
dns-resolver:
config: {}
running:
search: []
server:
- 192.168.122.1
route-rules:
config: []
routes:
config: []
running:
- destination: fe80::/64
metric: 100
next-hop-address: ''
next-hop-interface: eth0
table-id: 254
- destination: 0.0.0.0/0
metric: 100
next-hop-address: 192.168.122.1
next-hop-interface: eth0
table-id: 254
- destination: 192.168.122.0/24
metric: 100
next-hop-address: ''
next-hop-interface: eth0
table-id: 254
interfaces:
- name: eth0
type: ethernet
state: up
ipv4:
enabled: true
address:
- ip: 192.168.122.238
prefix-length: 24
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
dhcp: true
ipv6:
enabled: true
address:
- ip: fe80::c3c9:c4f9:75b1:a570
prefix-length: 64
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
autoconf: true
dhcp: true
lldp:
enabled: false
mac-address: 52:54:00:91:E4:4E
mtu: 1500
```
 As you can see above the networking configuration shows four main sections:
* **dns-resolver**: this section has the nameserver configuration for this interface.
* **route-rules**: it states the routing rules. 
* **routes**: it includes both dynamic and static routes.
* **Interfaces**: this section describes both ipv4 and ipv6 settings.
### Modify the configuration
You can modify the desired configuration state in two modes: 
* **Interactive**: editing the interface configuration through _nmstatectl edit_. This command invokes the text editor defined by the environment variable EDITOR so the network state can be edited in yaml format. After finishing the edition NMState will apply the new network configuration unless there are syntax errors.
* **File-based**: applying the interface configuration using _nmstatectl apply_ which imports a desired configuration state from a yaml or json file earlier created.
The following sections show you how to change the networking configuration using NMState. These changes can be disruptive to the system so the recommendation is to perform these tasks on a test system or guest VM till you get a better understanding of NMState.
The test system in use herehas two Ethernet interfaces: _eth0_ and _eth1_:
```
$ ip -br -4 a
lo UNKNOWN 127.0.0.1/8
eth0 UP 192.168.122.238/24
eth1 UP 192.168.122.108/24
```
#### Example of interactive configuration mode:
```
Change the MTU of eth0 interface to 9000 bytes using the nmstatectl edit command as follows (all changes are in bold):
```
```
$ sudo nmstatectl edit eth0
---
dns-resolver:
config: {}
running:
search: []
server:
- 192.168.122.1
route-rules:
config: []
routes:
config: []
running:
- destination: fe80::/64
metric: 100
next-hop-address: ''
next-hop-interface: eth0
table-id: 254
- destination: 0.0.0.0/0
metric: 100
next-hop-address: 192.168.122.1
next-hop-interface: eth0
table-id: 254
- destination: 192.168.122.0/24
metric: 100
next-hop-address: ''
next-hop-interface: eth0
table-id: 254
interfaces:
- name: eth0
type: ethernet
state: up
ipv4:
enabled: true
address:
- ip: 192.168.122.123
prefix-length: 24
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
dhcp: true
ipv6:
enabled: true
address:
- ip: fe80::c3c9:c4f9:75b1:a570
prefix-length: 64
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
autoconf: true
dhcp: true
lldp:
enabled: false
mac-address: 52:54:00:91:E4:4E
mtu: 9000
```
After saving and exiting the edito, NMState applies the new network desired state:
```
2021-06-29 11:29:05,726 root DEBUG Nmstate version: 1.0.3
2021-06-29 11:29:05,726 root DEBUG Applying desire state: {'dns-resolver': {'config': {}, 'running': {'search': [], 'server': ['192.168.122.1']}}, 'route-rules': {'config': []}, 'routes': {'config': [], 'running': [{'destination': 'fe80::/64', 'metric': 102, 'next-hop-address': '', 'next-hop-interface': 'eth0', 'table-id': 254}, {'destination': '0.0.0.0/0', 'metric': 102, 'next-hop-address': '192.168.122.1', 'next-hop-interface': 'eth0', 'table-id': 254}, {'destination': '192.168.122.0/24', 'metric': 102, 'next-hop-address': '', 'next-hop-interface': 'eth0', 'table-id': 254}]}, 'interfaces': [{'name': 'eth0', 'type': 'ethernet', 'state': 'up', 'ipv4': {'enabled': True, 'address': [{'ip': '192.168.122.238', 'prefix-length': 24}], 'auto-dns': True, 'auto-gateway': True, 'auto-route-table-id': 0, 'auto-routes': True, 'dhcp': True}, 'ipv6': {'enabled': True, 'address': [{'ip': 'fe80::5054:ff:fe91:e44e', 'prefix-length': 64}], 'auto-dns': True, 'auto-gateway': True, 'auto-route-table-id': 0, 'auto-routes': True, 'autoconf': True, 'dhcp': True}, 'lldp': {'enabled': False}, 'mac-address': '52:54:00:91:E4:4E', 'mtu': 9000}]}
--- output omitted ---
2021-06-29 11:29:05,760 root DEBUG Async action: Update profile uuid:2bdee700-f62b-365a-bd1d-69d9c31a9f0c iface:eth0 type:ethernet started
2021-06-29 11:29:05,792 root DEBUG Async action: Update profile uuid:2bdee700-f62b-365a-bd1d-69d9c31a9f0c iface:eth0 type:ethernet finished
```
Now, use both the _ip_ command and also the _eth0_ configuration file to check that the _MTU_ of _eth0_ is 9000 bytes.
```
$ ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:91:e4:4e brd ff:ff:ff:ff:ff:ff
altname enp1s0
$ sudo cat /etc/NetworkManager/system-connections/eth0.nmconnection
[sudo] password for admin:
[connection]
id=eth0
uuid=2bdee700-f62b-365a-bd1d-69d9c31a9f0c
type=ethernet
interface-name=eth0
lldp=0
permissions=
[ethernet]
cloned-mac-address=52:54:00:91:E4:4E
mac-address-blacklist=
mtu=9000
[ipv4]
dhcp-client-id=mac
dhcp-timeout=2147483647
dns-search=
method=auto
[ipv6]
addr-gen-mode=eui64
dhcp-duid=ll
dhcp-iaid=mac
dhcp-timeout=2147483647
dns-search=
method=auto
ra-timeout=2147483647
[proxy]
```
#### Example of file-based configuration mode:
Lets use the file-based approach to set a new config state. In this case disable the IPv6 configuration in _eth1_ interface.
First, create a yaml file to define the desired state of the _eth1_ interface. Use _nmstatectl show_ to save the current settings then _nmstatectl edit_ to disable IPv6. Again, all changes are in bold and deletions are shown with strike-through:
```
$ nmstatectl show eth1 > eth1.yaml
$ vi eth1.yaml
---
dns-resolver:
config: {}
running:
search: []
server:
- 192.168.122.1
route-rules:
config: []
routes:
config: []
running:
- destination: fe80::/64
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
- destination: 0.0.0.0/0
metric: 101
next-hop-address: 192.168.122.1
next-hop-interface: eth1
table-id: 254
- destination: 192.168.122.0/24
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
interfaces:
- name: eth1
type: ethernet
state: up
ipv4:
enabled: true
address:
- ip: 192.168.122.108
prefix-length: 24
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
dhcp: true
ipv6:
enabled: false
address:
- ip: fe80::5054:ff:fe3c:9b04
prefix-length: 64
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
autoconf: true
dhcp: true
lldp:
enabled: false
mac-address: 52:54:00:3C:9B:04
mtu: 1500
```
After saving the new configuration, use it to apply the new state:
```
$ sudo nmstatectl apply eth1.yaml
2021-06-29 12:17:21,531 root DEBUG Nmstate version: 1.0.3
2021-06-29 12:17:21,531 root DEBUG Applying desire state: {'dns-resolver': {'config': {}, 'running': {'search': [], 'server': ['192.168.122.1']}}, 'route-rules': {'config': []}, 'routes': {'config': [], 'running': [{'destination': 'fe80::/64', 'metric': 101, 'next-hop-address': '', 'next-hop-interface': 'eth1', 'table-id': 254}, {'destination': '0.0.0.0/0', 'metric': 101, 'next-hop-address': '192.168.122.1', 'next-hop-interface': 'eth1', 'table-id': 254}, {'destination': '192.168.122.0/24', 'metric': 101, 'next-hop-address': '', 'next-hop-interface': 'eth1', 'table-id': 254}]}, 'interfaces': [{'name': 'eth1', 'type': 'ethernet', 'state': 'up', 'ipv4': {'enabled': True, 'address': [{'ip': '192.168.122.108', 'prefix-length': 24}], 'auto-dns': True, 'auto-gateway': True, 'auto-route-table-id': 0, 'auto-routes': True, 'dhcp': True}, 'ipv6': {'enabled': False}, 'lldp': {'enabled': False}, 'mac-address': '52:54:00:3C:9B:04', 'mtu': 1500}]}
--- output omitted ---
2021-06-29 12:17:21,582 root DEBUG Async action: Update profile uuid:5d7244cb-673d-3b88-a675-32e31fad4347 iface:eth1 type:ethernet started
2021-06-29 12:17:21,587 root DEBUG Async action: Update profile uuid:5d7244cb-673d-3b88-a675-32e31fad4347 iface:eth1 type:ethernet finished
--- output omitted ---
Desired state applied:
---
dns-resolver:
config: {}
running:
search: []
server:
- 192.168.122.1
route-rules:
config: []
routes:
config: []
running:
- destination: fe80::/64
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
- destination: 0.0.0.0/0
metric: 101
next-hop-address: 192.168.122.1
next-hop-interface: eth1
table-id: 254
- destination: 192.168.122.0/24
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
interfaces:
- name: eth1
type: ethernet
state: up
ipv4:
enabled: true
address:
- ip: 192.168.122.108
prefix-length: 24
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
dhcp: true
ipv6:
enabled: false
lldp:
enabled: false
mac-address: 52:54:00:3C:9B:04
mtu: 1500
```
You can check that the _eth1_ interface does not have any IPv6 configured:
```
$ ip -br a
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.122.238/24 fe80::5054:ff:fe91:e44e/64
eth1 UP 192.168.122.108/24
$ sudo cat /etc/NetworkManager/system-connections/eth1.nmconnection
[connection]
id=eth1
uuid=5d7244cb-673d-3b88-a675-32e31fad4347
type=ethernet
interface-name=eth1
lldp=0
permissions=
[ethernet]
cloned-mac-address=52:54:00:3C:9B:04
mac-address-blacklist=
mtu=1500
[ipv4]
dhcp-client-id=mac
dhcp-timeout=2147483647
dns-search=
method=auto
[ipv6]
addr-gen-mode=eui64
dhcp-duid=ll
dhcp-iaid=mac
dns-search=
method=disabled
[proxy]
```
#### Applying changes temporarily
An interesting feature of NMState allows you to configure a desired networking state temporarily. In case you are satisfied with the configuration you can commit it afterwards. Otherwise it will rollback when the timeout expires (default is 60 sec).
Modify the _eth1_ configuration from the previous example so it has an IPv4 static address instead of getting it dynamically by DHCP.
```
$ vi eth1.yaml
---
dns-resolver:
config: {}
running:
search: []
server:
- 192.168.122.1
route-rules:
config: []
routes:
config: []
running:
- destination: fe80::/64
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
- destination: 0.0.0.0/0
metric: 101
next-hop-address: 192.168.122.1
next-hop-interface: eth1
table-id: 254
- destination: 192.168.122.0/24
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
interfaces:
- name: eth1
type: ethernet
state: up
ipv4:
enabled: true
address:
- ip: 192.168.122.110
prefix-length: 24
auto-dns: true
auto-gateway: true
auto-route-table-id: 0
auto-routes: true
dhcp: false
ipv6:
enabled: false
lldp:
enabled: false
mac-address: 52:54:00:3C:9B:04
mtu: 1500
```
Now, apply this config temporarily using the option _no-commit_ so it will be valid only for 30 seconds. This can be done adding the option _timeout_. Meanwhile, we will run the _ip  -br a_ command three times to see how the IPv4 address configured in _eth1_ interface changes and then the configuration rolls back.
```
$ ip -br a && sudo nmstatectl apply --no-commit --timeout 30 eth1.yaml && sleep 10 && ip -br a && sleep 25 && ip -br a
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.122.238/24 fe80::5054:ff:fe91:e44e/64
eth1 UP 192.168.122.108/24
2021-06-29 17:29:18,266 root DEBUG Nmstate version: 1.0.3
2021-06-29 17:29:18,267 root DEBUG Applying desire state: {'dns-resolver': {'config': {}, 'running': {'search': [], 'server': ['192.168.122.1']}}, 'route-rules': {'config': []}, 'routes': {'config': [], 'running': [{'destination': 'fe80::/64', 'metric': 101, 'next-hop-address': '', 'next-hop-interface': 'eth1', 'table-id': 254}, {'destination': '0.0.0.0/0', 'metric': 101, 'next-hop-address': '192.168.122.1', 'next-hop-interface': 'eth1', 'table-id': 254}, {'destination': '192.168.122.0/24', 'metric': 101, 'next-hop-address': '', 'next-hop-interface': 'eth1', 'table-id': 254}]}, 'interfaces': [{'name': 'eth1', 'type': 'ethernet', 'state': 'up', 'ipv4': {'enabled': True, 'address': [{'ip': '192.168.122.110', 'prefix-length': 24}], 'dhcp': False}, 'ipv6': {'enabled': False}, 'lldp': {'enabled': False}, 'mac-address': '52:54:00:3C:9B:04', 'mtu': 1500}]}
--- output omitted ---
Desired state applied:
---
dns-resolver:
config: {}
running:
search: []
server:
- 192.168.122.1
route-rules:
config: []
routes:
config: []
running:
- destination: fe80::/64
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
- destination: 0.0.0.0/0
metric: 101
next-hop-address: 192.168.122.1
next-hop-interface: eth1
table-id: 254
- destination: 192.168.122.0/24
metric: 101
next-hop-address: ''
next-hop-interface: eth1
table-id: 254
interfaces:
- name: eth1
type: ethernet
state: up
ipv4:
enabled: true
address:
- ip: 192.168.122.110
prefix-length: 24
dhcp: false
ipv6:
enabled: false
lldp:
enabled: false
mac-address: 52:54:00:3C:9B:04
mtu: 1500
Checkpoint: NetworkManager|/org/freedesktop/NetworkManager/Checkpoint/7
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.122.238/24 fe80::5054:ff:fe91:e44e/64
eth1 UP 192.168.122.110/24
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.122.238/24 fe80::5054:ff:fe91:e44e/64
eth1 UP 192.168.122.108/24
```
As you can see from above, the _eth1_ IP address changed temporarily from 192.168.122.108 to 192.168.122.110 and then it returned to 192.168.122.108 after the timeout expired.
### Conclusion
NMState is a declarative networking configuration tool that currently applies the desired networking configuration state in a host through the NetworkManager API. This state can be defined either interactively using a text editor or with a file-based approach creating a yaml or json file.
This kind of tool provides Infrastructure as Code, it allows the automation of networking tasks and also reduces potential misconfigurations or unstable networking scenarios that could arise using legacy configuration methods.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/nmstate-a-declarative-networking-config-tool/
作者:[Maurizio Garcia][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/malgnuz/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/magic-816x345.jpg
[2]: https://unsplash.com/@marigard?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/magic?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://nmstate.io/
[5]: https://github.com/nmstate/nmstate

View File

@ -0,0 +1,215 @@
[#]: subject: "Parsing command options in Lua"
[#]: via: "https://opensource.com/article/21/8/parsing-commands-lua"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Parsing command options in Lua
======
My favorite way to solve the problem of parsing in Lua is alt-getopt.
![Woman sitting in front of her laptop][1]
When you enter a command into your terminal, there are usually [options][2], also called _switches_ or _flags_, that you can use to modify how the command runs. This is a useful convention defined by the [POSIX specification][3], so as a programmer, it's helpful to know how to detect and parse options.
As with most languages, there are several ways to solve the problem of parsing options in Lua. My favorite is [alt-getopt][4].
### Installing
The easiest way to obtain and use **alt-getopt** in your code is to [install it with LuaRocks][5]. For most use-cases, you probably want to install it into your local project directory:
```
$ mkdir local
$ luarocks --tree=local install alt-getopt 
Installing <https://luarocks.org/alt-getopt-0.X.Y-1.src.rock>
[...]
alt-getopt 0.X.Y-1 is now installed in /tux/myproject/local (license: MIT/X11)
```
Alternately, you can download the code from [GitHub][6].
### Adding a library to your Lua code
Assuming you've installed the library locally, then you can define your Lua package path and then `require` the **alt-getopt** package:
```
package.path = package.path .. ';local/share/lua/5.1/?.lua'
local alt_getopt = require("alt_getopt")
```
If you've installed it to a known system location, you can omit the `package.path` line (because Lua already knows to look for system-wide libraries.)
Now you're set to parse options in Lua.
### Option parsing in Lua
The first thing you must do to parse options is to define the valid options your application can accept. The **alt_getopt** library sees all options primarily as short options, meaning that you define options as single letters. You can add long versions later.
When you define valid options, you create a list delimited by colons (`:`), which is interpreted by the `get_opts` function provided by **alt-getopts**.
First, create some variables to represent the options. The variables `short_opt` and `optarg` represent the short option and the option argument. These are arbitrary variable names, so you can call them anything (as long as it's a valid name for a variable).
The table `long_opts` must exist, but I find it easiest to define the values of the long options after you've decided on the short options, so leave it empty for now.
```
local long_opts = {}
local short_opt
local optarg
```
With those variables declared, you can iterate over the arguments provided by the user, checking to see whether any argument matches your approved list of valid short options.
If a valid option is found, you use the `pairs` function in Lua to extract the value of the option.
To create an option that accepts no argument of its own but is either _on_ or _off_ (often called a _switch_), you place the short option you want to define to the right of a colon (`:`) character.
In this example, I've created a loop to check for the short option `-a`, which is a switch:
```
short_opt,optarg = alt_getopt.get_opts (arg, ":a", long_opts)
local optvalues = {}
for k,v in pairs (short_opt) do
   table.insert (optvalues, "value of " .. k .. " is " .. v .. "\n")
end
table.sort (optvalues)
io.write (table.concat (optvalues))
for i = optarg,#arg do
   io.write (string.format ("ARGV [%s] = %s\n", i, arg [i]))
end
```
At the end of this sample code, I included a for-loop to iterate over any remaining arguments in the command because anything not detected as a valid option must be an argument (probably a file name, URI, or whatever it is that your application operates upon).
Test the code:
```
$ lua test.lua -a 
value of a is 1
```
The test script has successfully detected the option `-a`, and has assigned it a value of **1** to represent that it does exist.
Try it again with an extra argument:
```
$ lua test.lua -a hello
value of a is 1
ARGV [2] = hello
```
### Options with arguments
Some options require an argument all their own. For instance, you might want to allow the user to point your application to a custom configuration file, set an attribute to a color, or set the resolution of a graphic. In **alt_getopt**, options that accept arguments are placed on the left of the colon (`:`) in the short options list.
```
`short_opt,optarg = alt_getopt.get_opts (arg, "c:a", long_opts)`
```
Test the code:
```
$ lua test.lua -a -c my.config
value of a is 1
value of c is my.config
```
Try it again, this time with a spare argument:
```
$ lua test.lua -a -c my.config hello
value of a is 1
value of c is my.config
ARGV [4] = hello
```
### Long options
Short options are great for power users, but they don't tend to be very memorable. You can create a table of long options that point to short options so users can learn long options before abbreviating their commands with single-letter options.
```
local long_opts = {
   alpha = "a",
   config = "c"
}
```
Users now have the choice between long and short options:
```
$ lua test.lua --config my.config --alpha hello
value of a is 1
value of c is my.config
ARGV [4] = hello
```
### Option parsing
Here's the full demonstration code for your reference:
```
#!/usr/bin/env lua
package.path = package.path .. ';local/share/lua/5.1/?.lua'
local alt_getopt = require("alt_getopt")
local long_opts = {
   alpha = "a",
   config = "c"
}
local short_opt
local optarg
short_opt,optarg = alt_getopt.get_opts (arg, "c:a", long_opts)
local optvalues = {}
for k,v in pairs (short_opt) do
   table.insert (optvalues, "value of " .. k .. " is " .. v .. "\n")
end
table.sort (optvalues)
io.write (table.concat (optvalues))
for i = optarg,#arg do
   io.write (string.format ("ARGV [%s] = %s\n", i, arg [i]))
end
```
There are further examples in the project's Git repository. Including options for your users is an important feature for any application, and Lua makes it easy to do. There are other libraries aside from **alt_getopt**, but I find this one easy and quick to use.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/parsing-commands-lua
作者:[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
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop)
[2]: https://opensource.com/article/21/7/linux-terminal-basics#options
[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
[4]: https://luarocks.org/modules/mpeterv/alt-getopt
[5]: https://opensource.com/article/19/11/getting-started-luarocks
[6]: https://github.com/cheusov/lua-alt-getopt

View File

@ -0,0 +1,130 @@
[#]: subject: "What is Firefox Multi-Account Containers? Why and How to Use It?"
[#]: via: "https://itsfoss.com/firefox-containers/"
[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What is Firefox Multi-Account Containers? Why and How to Use It?
======
As the needs of users who use various programs on their devices becomes increasingly complex, the programs themselves are also needing to follow suit to keep up with the demand that users are wanting and expecting.
Something that I find I need on a daily basis is an easy way to be able to stay logged in to multiple accounts inside my web browser at the same time. I _could_ just log in and out of each of my accounts as needed, but this becomes extremely tedious when Im moving across multiple accounts in a short period of time.
Originally, I was using Google Chromes ability to have multiple accounts, which worked, but was a tad too tedious to manage, and it felt a bit clunky to create an entire new Google account just to do what I considered something that should be able to be done from a _single_ account.
This is the point where I moved to Firefoxs Multi-Account Containers feature. Not only is it so much more flexible than my setup on Google Chrome, but I am also using something that is created by my browsers developers themselves, making for an overall smoother and simpler experience.
![Illustration of containers in Firefox][1]
### What is Multi-Account Container in Firefox?
Mutli-Account Containers also works tremendously well if you want to separate parts of your digital life from each other. When you are using containers, your browsing activity from one container is not shared with other containers. This isolation means that you can log into two separate accounts on the same website in different containers. Your login session, site preference and tracking data will be confined to the container where you used a certain website.
What other advantage does it have? Imagine you were shopping on Amazon or some other e-commerce. You browsed a few items but did not buy anything. Now if you browse the web, youll see ads related to products you browsed. Some websites show ads despite ad-blockers. With containers, you can separate your shopping websites with other websites.
Let me share another example with you. Firefox provides a Facebook container by default. This container includes Facebook, Messenger and Instagram websites by default. This means when you open any of these three websites, they are opened in Facebook container. Thus, Facebook wont be able to track your activity on other websites.
This is one of the [Firefox features that not many people know or use][2].
### Using Multi-Account Containers
Installing Firefox Multi-Account containers is an extremely simple process, and only takes a few clicks.
First, head over to the [extensions page][3] on the Firefox Add-ons website. The only thing you need to do after that is click the `Add to Firefox` button.
![][4]
And youre done! Now we can get straight into actually using the new extension.
If you didnt notice already, there should now be a new icon to the right of your search bar:
![][5]
This is the icon that youll use to interact with Firefox Multi-Account containers. If you then click the icon, youll be greeted with a little menu:
![][6]
With that, lets try some examples out so we can see how Multi-Account Containers actually works.
#### Setting up the container
First off, we need to make a container. We can do this by going to `Manage Containers -> New Container` in the Multi-Account Containers menu.
![][7]
![][8]
Next, enter the name for the new container, and select a color and icon. Then, hit `OK` to save the new container.
![][9]
And thats it! We can now go back to the main menu to open a new tab inside the new container:
![][10]
You will also notice that the new tab has some styling to denote that its running inside of a container:
![][11]
#### Watching the container work in action
Lets now look at what the container actually does when you use it.
Were going to go to the Linode manager website in a normal browser tab, where Im currently signed in:
![][12]
Lets now try opening the same page inside our Firefox container, at which point Im redirected to the Linode login screen:
![][13]
Why was I redirected? Because now I am not logged in. Thats one of the joys of Firefox containers: be able to be signed in inside of one browser session, and then enter a container, and its like youve never visited the site before.
If you were to sign in to a website within the container however, you would stay signed in while vising websites from the container. You could also use this feature to sign in to a website from inside the container, thus keeping all the data from that site away from your normal browser data.
Note
Things like your browser history itself will still be exposed to your normal browser session. The container feature simply provides a way to separate things like signed-in accounts as mentioned in this article.
### Wrapping Up
Mutli-Account Containers prove to be a wonderful feature for those who are conscious about their privacy, or just want to really try to get stringent on the security of their systems.
For example, you could sign in to your Google account inside of a container, and Google would never know who you whenever you arent inside the container.
And then lastly, this extension is just a great choice for people who want to sign into to multiple accounts at once, without resorting to making separate browser accounts for each thing you want to use.
And there you go, thats the premise of Firefoxs Multi-Account Containers.
Need any help getting everything going, or just got a general question? Feel free to leave any of it in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/firefox-containers/
作者:[Hunter Wittenborn][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://itsfoss.com/author/hunter/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Firefox-container.png?resize=800%2C450&ssl=1
[2]: https://itsfoss.com/firefox-useful-features/
[3]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-install-page.png?resize=800%2C366&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-searchbar-icon-1.png?resize=800%2C48&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-main-menu.png?resize=302%2C474&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-manage-containers-1.png?resize=291%2C402&ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container.png?resize=290%2C399&ssl=1
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-itsfoss.png?resize=292%2C401&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-opening-new-container.png?resize=290%2C398&ssl=1
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-styling.png?resize=800%2C370&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode.png?resize=800%2C114&ssl=1
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode-login.png?resize=800%2C405&ssl=1

View File

@ -0,0 +1,192 @@
[#]: subject: "How I use Terraform and Helm to deploy the Kubernetes Dashboard"
[#]: via: "https://opensource.com/article/21/8/terraform-deploy-helm"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How I use Terraform and Helm to deploy the Kubernetes Dashboard
======
Terraform can deploy Helm Charts. Is it right for you?
![Ship captain sailing the Kubernetes seas][1]
When I'm working on projects that require provisioning cloud infrastructure, my workflow has two disparate components: one is infrastructure orchestration, which includes Terraform to bring up the infrastructure (for instance, new EKS clusters), and the second is the provisioning component, which includes Ansible or Bash scripts to instantiate and initialize that infrastructure to accept new deployments (for instance, installing Cluster Autoscaler, kube-state-metrics, and so on.)
The reason for this is simple: very few tools can cross over and handle both the orchestration and the provisioning side. When I stumbled on the Helm provider for Terraform, I wanted to explore the possibility of using one tool to handle both sides: using Terraform to bring up a new EKS cluster and provision it with Prometheus, Loki, Grafana, Cluster Autoscaler, and others, all in one neat and clean deployment. But that's not happening until I figure out how to use this thing, so below is my experience using Terraform and Helm for something simple: deploying the Kubernetes Dashboard.
### The Helm provider
The Helm provider works like the other cloud providers. You can specify the path of the `KUBECONFIG` or other credentials, run `terraform init`, and the Helm provider gets initialized.
### Deploying the Kubernetes Dashboard
I'm going to use [Minikube for this test][2].
My `main.tf` file contains the following:
```
provider "helm" {
  kubernetes {
    config_path = "~/.kube/config"
  }
}
resource "helm_release" "my-kubernetes-dashboard" {
  name = "my-kubernetes-dashboard"
  repository = "<https://kubernetes.github.io/dashboard/>"
  chart      = "kubernetes-dashboard"
  namespace  = "default"
  set {
    name  = "service.type"
    value = "LoadBalancer"
  }
  set {
    name  = "protocolHttp"
    value = "true"
  }
  set {
    name  = "service.externalPort"
    value = 80
  }
  set {
    name  = "replicaCount"
    value = 2
  }
  set {
    name  = "rbac.clusterReadOnlyRole"
    value = "true"
  }
}
```
In the above Terraform, I'm deploying the `kubernetes-dashboard` Chart from `https://kubernetes.github.io/dashboard/` into the namespace `default`. I'm also using the `set` variable to override the Chart's defaults:
1. `service.type`: I'm changing this to `LoadBalancer` to review my changes locally. Remember to run `minikube tunnel` in a separate window, or this won't work.
2. `protocolHttp`: I'm deploying the non-secure version to suppress HTTPS warnings on `localhost`.
3. `service.externalPort`: This needs to be 80 for non-secure.
4. `replicaCount`: I'm changing this to 2 to see if these changes even work :)
5. `rbac.clusterReadOnlyRole`: This should be `true` for the Dashboard to have the correct permissions.
### Executing our Terraform
Let's start by initializing Terraform with `terraform init`:
```
Initializing the backend...
Initializing provider plugins...
\- Finding latest version of hashicorp/helm...
\- Installing hashicorp/helm v2.2.0...
\- Installed hashicorp/helm v2.2.0 (signed by HashiCorp)
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
```
So far, so good. Terraform successfully initialized the Helm provider. And now for `terraform apply`:
```
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create
Terraform will perform the following actions:
  # helm_release.my-kubernetes-dashboard will be created
  + resource "helm_release" "my-kubernetes-dashboard" {
      + atomic                     = false
      + chart                      = "kubernetes-dashboard"
      + cleanup_on_fail            = false
      [...]
      + set {
          + name  = "service.type"
          + value = "LoadBalancer"
        }
    }
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.
  Enter a value: yes
helm_release.my-kubernetes-dashboard: Creating...
helm_release.my-kubernetes-dashboard: Still creating... [10s elapsed]
helm_release.my-kubernetes-dashboard: Creation complete after 14s [id=my-kubernetes-dashboard]
```
(Remember to run `minikube tunnel` in another terminal window, otherwise the `apply` won't work).
### Verifying our changes
Let's check if our pods are up using `kubectl get po` and `kubectl get svc`:
```
~ kubectl get po
NAME                                       READY   STATUS    RESTARTS   AGE
my-kubernetes-dashboard-7bc7ccfbd9-56w56   1/1     Running   0          18m
my-kubernetes-dashboard-7bc7ccfbd9-f6jc4   1/1     Running   0          18m
~ kubectl get svc
NAME                      TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)        AGE
kubernetes                ClusterIP      10.96.0.1        &lt;none&gt;           443/TCP        20m
my-kubernetes-dashboard   LoadBalancer   10.104.144.125   10.104.144.125   80:32066/TCP   19m
```
Our pods are deployed, and the load balancer is working. Now check the UI: 
![Kubernetes Workloads dashboard][3]
Figure 2: Kubernetes Workloads dashboard
### Conclusion
You can [find the examples from this article in my Gitlab repo][4].
With Helm provisioning now a part of Terraform, my work life is that much easier. I do realize that the separation between Infrastructure and Provisioning served a different purpose: Infrastructure changes were usually one-off or didn't require frequent updates, maybe a few times when governance or security rules for my org changed. Provisioning changes, on the other hand, frequently occurred, sometimes with every release. So having Terraform (Infrastructure) and Helm Charts (Provisioning) in two different repos with two different tools and two different review workflows made sense. I'm not sure merging them using a single tool is the best idea, but one less tool in the toolchain is always a huge win. I think the pros and cons of this will vary from one project to another and one team to another.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/terraform-deploy-helm
作者:[Ayush Sharma][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/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas)
[2]: https://opensource.com/article/18/10/getting-started-minikube
[3]: https://opensource.com/sites/default/files/2021-07-12-terraform-plus-helm-a-match-made-in-heaven-hell-dashboard.png
[4]: https://gitlab.com/ayush-sharma/example-assets/-/tree/main/kubernetes/tf_helm

View File

@ -0,0 +1,109 @@
[#]: subject: "How to get the most out of GitOps right now"
[#]: via: "https://opensource.com/article/21/8/gitops"
[#]: author: "Itiel Shwartz https://opensource.com/users/itielschwartz2021"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to get the most out of GitOps right now
======
GitOps is a great starting point to understand what is running in
production, but it may need a little more augmentation to get it working
just right for your engineering team.
![Team checklist and to dos][1]
You may have encountered this brief introduction to GitOps shared by prevalent cloud software engineer, [Kelsey Hightower][2]:
> GitOps: versioned CI/CD on top of declarative infrastructure. Stop scripting and start shipping. <https://t.co/SgUlHgNrnY>
>
> — Kelsey Hightower (@kelseyhightower) [January 17, 2018][3]
In the world of [infrastructure as code][4], GitOps is a popular way to manage automated deployments through continuous integration/continuous development (CI/CD) and microservices architecture in general, as most of our infrastructure is essentially defined in config files today (e.g., YAML, JSON, HCL). This is not limited to Kubernetes (K8s), but it's often highly associated with K8s clusters. (I'll explain why in a second.) This basically means that changing anything in your production infrastructure is as simple as changing a line of code.
The reason GitOps is so closely identified with K8s is that K8s is completely configured in declarative YAML, and therefore, you can quickly achieve the benefits of using GitOps as it is really just software-defined infrastructure. When it comes to properly applying GitOps in your engineering organization, the main thing you need to pay attention to is how you enforce changes to your cluster or infrastructure.
When you choose the GitOps path, you can only do it through a single source of truth: your source-code management (SCM) repository (e.g., GitLab, GitHub, Bitbucket, or your own hosting solution) that enforces the version-control policy for your entire organization. This means the only way to make changes to your infrastructure is through a pull request in your repository. This is how version control is maintained at scale in large engineering organizations using GitOps.
### The state of real-world deployments
The GitOps doctrine claims to be the new and simpler way to achieve CI/CD, except that the CD part of CI/CD is a much more complex beast than GitOps practices would have you believe. With GitOps, the CD part breaks down to a very binary approach to engineering environments. You're either in staging or production, where you just flip the switch and your code is in production. In my years of experience as an engineer, I have yet to participate in a significant code change, feature rollout, or another major deployment that is that simple.
There is plenty more legwork encapsulated in staging or production versioning completely abstracted from the CD process with GitOps. This means that any engineering process that takes quality seriously will have a few stages between the CI and CD phases of a major deployment. These include testing, validating results, verifying that changes propagated, retesting, and often doing partial rollouts (canary and such). These are just a few examples of how CD is managed in engineering organizations.
#### GitOps tips for doing deployments better
When it comes to GitOps, there's no need to reinvent the CI/CD (and particularly the CD) wheel. If you're like most people and achieve CI/CD by duct taping your CD process with some custom scripts before and after deployment to get it over the finish line, know there are better ways to do this with GitOps facilitators. Using GitOps facilitators such as the open source, Cloud Native Computing Foundation (CNCF)-hosted [Argo CD][5] enables users to take all those custom scripts and manage them at scale in a single place. This ensures best practices when using scripts in your CI/CD process, making them canonical and repeatable every time they run.
What's more, since there is an agent that is continuously syncing state, it reduces human errors by enforcing the committed state.
### Manage chaos across repositories with GitOps
With complex deployment architectures such as K8s or even just plain old microservices, even small changes to the code often affect other interdependent services. Mapping these dependencies with GitOps tends to become a hellscape. Often with shared repos and files, you need to sync the state. However, what you'll also often find is that errors, misconfigurations, or even just bugs can create a [butterfly effect][6] that starts a cascade of failures that becomes extremely hard to track and understand in GitOps.
One common method to solve this challenge with GitOps is to create a "super repo," which is essentially a centralized monorepo that contains pointers to all the relevant dependencies, files, resources, and such. However, this quickly becomes a messy garbage bag "catchall" of a repository, where it is extremely hard to understand, track, and log changes.
When you have many dependencies, for this to work in GitOps, these dependencies need to be represented in Git. This requires your organization to be "Git native." This means you'll need to do a lot of duct-tape automation work to create modules and submodules to connect and correlate between your super repo and the relevant subrepos. Many times, this comes with a lot of maintenance overhead that becomes extremely difficult to maintain over time.
If you don't do this, you're not achieving the benefits of GitOps, and you're mostly just stuck with the downsides. You could achieve similar capabilities through a YAML file that encapsulates all the versions and dependencies, similar to a Helm umbrella chart. Without going fully Git native, you could essentially be anything else—and not GitOps.
While in the GitOps world, repos represent the single source of truth for environments, in practice, there are many third-party integrations in any given deployment. These integrations can be anything from your authentication and authorization (e.g., Auth0) to your database, which are, for the most part, updated externally to your repo. These changes to external resources, which could significantly impact your production and deployments, have no representation inside your single-source-of-truth repo at all. This could be a serious blind spot in your entire deployment.
#### GitOps tips for managing chaos better
When using GitOps, treat your configurations the same way you would treat your code. Don't scrimp on validation pipelines, ensure proper pull request hygiene, and maintain any other practices you apply when managing code at scale to avoid this chaos. Don't panic! If something incorrect gets pushed and you're concerned it will propagate to all servers, clusters, and repos, all you need to do is run `git revert`, and you can undo your last commit.
Also, similar to my recommendation regarding syncing state, using GitOps facilitators can help with managing Git practices, being Git native, and handling Kubernetes deployments (as well as being Kubernetes native).
Last, to avoid any disorder or complexity, ensure that your Git repository's state is as close as possible to your production environments to avoid any drift of your environments from your GitOps operation.
### 3 tips for using GitOps
Here are my tips for getting the most out of GitOps:
1. Make sure to build visibility into your GitOps automation early, so you're not running blind across your many repos. When it comes to making GitOps work optimally, you should work out of a single repo per application. When these start to add up, visibility can become a real pain point. Think about the dependencies and how to engineer enough visibility into the system, so if something goes wrong, you'll know how to track it down to its source and fix it.
2. One way to do that is to plan for every kind of failure scenario. What happens when dependencies crash? When it comes to GitOps, merge conflicts are a way of life. How do you manage high-velocity deployments and promotions to production that can overwhelm a GitOps system? Think about the many potential challenges, failures, and conflicts, and have a playbook for each. Also, following up on the first point, make sure there is sufficient visibility for each to troubleshoot rapidly. And of course, don't forget the `git revert` command in the event failure happens.
3. Use a monorepo. There, I said it. The age-old mono vs. multi-repo debate. When it comes to GitOps, there's no question which is the better choice. While a centralized monorepo has disadvantages (e.g., it can get messy, become a nightmare to understand build processes, etc.), it also can help solve a large majority of hassles with cross-repo dependencies.
As an engineer, I felt this pain directly. I realized there's a pressing need for something to correlate these dependencies and visibility challenges I felt every single day of my GitOps life.
I wanted a better solution for tracking and cascading failures in a complex microservices setup to a root cause or code change. Everything I had tried to date, including GitOps, provided only partial information, very little correlation, and almost no causation.
GitOps tools (like Argo CD) help solve many issues that arise with DIY GitOps. Using such tools can be a good thing to consider when going down the GitOps route because they:
* Are natively designed for Kubernetes
* Are suitable for small teams using image-puller
* Have strong community support (e.g., Argo CD through the CNCF, which is also easy to use with other Argo tools)
* Provide an improved developer experience with a good user interface for applications
* Natively integrate with Git, which helps minimize chaos and complexity
### The bottom line
Deployment processes, particularly with new versions, are a _complex_ engineering feat. To get these right, you need to invest effort in both the technology and design of the process. For example, what is the best way to deploy and validate my application in production?
GitOps is a really good starting point to understand what is running in production. Just bear in mind that it may also need a little more augmentation with additional tools and DIY automation to get it working just right for your engineering team. This way, GitOps' shine is 24K rather than fool's gold for your organization.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/gitops
作者:[Itiel Shwartz][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/itielschwartz2021
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos)
[2]: https://twitter.com/kelseyhightower
[3]: https://twitter.com/kelseyhightower/status/953638870888849408?ref_src=twsrc%5Etfw
[4]: https://www.redhat.com/en/topics/automation/what-is-infrastructure-as-code-iac
[5]: https://argoproj.github.io/argo-cd/
[6]: https://en.wikipedia.org/wiki/Butterfly_effect

View File

@ -0,0 +1,101 @@
[#]: subject: "elementary OS 6 ODIN Released. This is Whats New."
[#]: via: "https://www.debugpoint.com/2021/08/elementary-os-6/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
elementary OS 6 ODIN Released. This is Whats New.
======
The team announced the release of elementary OS 6 ODIN, and it is
immediately available for download. We recap the release in this post.
![elementary OS 6 ODIN Desktop][1]
The elementary OS 6 code named “ODIN” was a long due. This release coming after more than two years since its predecessor, [elementary OS 5.1 Hera][2]. A lot had happened in the last two years, that includes a full-fledged pandemic. Despite all the challenges, roadblocks a brand new and much awaited release is here.
Lets take a look at whats new.
### elementary OS 6 Odin Whats New
The team promises the following items in a nutshell in this release:
> Empowering you to be in control and express yourself,
> Continuing to innovate with new features, and
> Making elementary OS easier to get and more inclusive
* This release is based on Ubuntu 20.04 and Linux Kernel 5.8. If you ask me, its late at this moment to have a new version of a distro based on Ubuntu 20.04 whereas next LTS is due in 2022.
* Dark theme and new ascent color is introduced in this release. With the dark theme enabled, all the default applications, windows automatically adapt to dark mode. This mode also can be set based on sunset and sunrise at your location.
* The ascent colors applied across the system when chosen. A fair and nice list of assent colors are available.
* The new dark theme is designed such as way that third party app developers can easily integrate their application to follow elementary OS stylesheet.
![Dark and Light theme][3]
* All apps in AppCenter are now Flatpak apps which runs in their separate sandbox. This is one of the best move by elementary team and all the Flatpak apps requires separate permission controls via settings.
* If you are a touchpad/touch device fan, then you are in for a treat. Three finger swipe up gestures brings up the activities overview.
* Three finger left and right swap between dynamic workspaces.
* And all the applicable apps uses two finger gestures.
* Notifications are revamped with new look and can follow dark theme.
* A new task application introduced to track your tasks and can sync with online accounts.
* elementary OS 6 comes with firmware updates built in, powered by the Linux Vendor Firmware Service. Firmware updates are provided for supported devices by hardware manufacturers like Star Labs, Dell, Lenovo, HP, Intel, Logitech, Wacom, 8bitdo, and many more—now supported devices can get the latest updates for security and stability straight from System Settings → System → Firmware or by searching the Applications Menu for “Firmware.”
* Native applications are updated and redesigned completely. Epiphany browser is renamed as Web. Mail is completely rewritten with tighter integration with online accounts.
* Files introduces a different behavioral change. You need to single click to browse folders, but double click for files. This can not be changed via gsettings.
* And many more updates, which you can read in the [change log][4] here.
[][5]
SEE ALSO:   elementary OS 6 Beta Released. Download and Test Now!
### Minimum System Requirement for elementary OS 6
Heres a system specification for this version, before you hit download.
* Recent Intel i3 or comparable dual-core 64-bit processor
* 4 GB of system memory (RAM)
* Solid state drive (SSD) with 15 GB of free space
* Internet access
* Built-in or wired mouse/touchpad and keyboard
* 1024×768 minimum resolution display
### elementary OD 6 Odin Download
The .iso files for the new release is available in below link. Due to rush, the servers might be busy, hence it is recommended to use torrents if possible.
[Download elementary OS 6 ODIN][6]
### How to Upgrade
There is no upgrade path available at the moment to upgrade to elementary 6 from elementary 5.1. Hence, you need to take backups and do a fresh installation via .iso available in above link.
### Closing Notes
There is no question that elementary OS is a one-of-a-kind Linux Distribution today. And its popularity is increasing everyday due to the awesome Pantheon desktop. It is one of the rare Linux distribution which appeals both macOS and Windows users. That said, I think the development process requires a bit faster and two years of the wait between versions is too long for IT. This release is based on Ubuntu 20.04 which is already two years old, and we have a new LTS coming up on 2022. And of course there is no upgrade path. I believe if the team work on these aspects, considering dedicated developers, donations, I think it would be one of the best Linux distro.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/08/elementary-os-6/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpg
[2]: https://www.debugpoint.com/2019/12/elementary-os-hera-released/
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Dark-and-Light-theme-1024x692.png
[4]: https://blog.elementary.io/elementary-os-6-odin-released/
[5]: https://www.debugpoint.com/2021/05/elementary-os-6-beta/
[6]: https://elementary.io/

View File

@ -3,7 +3,7 @@
[#]: author: (Alan Smithee https://opensource.com/users/alansmithee)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: reviewer: (turbokernel)
[#]: publisher: ( )
[#]: url: ( )
@ -12,19 +12,19 @@
学习kubectl提升你与 Kubernetes 的互动方式。
![Ship captain sailing the Kubernetes seas][1]
Kubernetes 是帮助你以有组织的方式运行大量容器的软件。除了提供工具来管理(或[编排][2])运行的容器,Kubernetes 还帮助这些容器根据需要进行扩展。有了 Kubernetes 作为你的中央控制面板(或称 _control plane_),你需要一种方法来管理 Kubernetes而这项工作的工具就是 kubectl。`kubectl` 命令让你控制、维护、分析和排 Kubernetes 集群的故障。与许多使用 `ctl`(“控制”的缩写)后缀的工具一样,如 systemctl 和 sysctlkubectl 拥有大量的功能和任务权限,所以如果你正在运行 Kubernetes你最终会经常使用它。它是一个有很多选项的大命令,所以下面是 kubectl 使之变得简单的五个常见任务。
Kubernetes 可以帮你编排运行大量容器的软件。Kubernetes 不仅提供工具来管理(或[编排][2])运行的容器,还帮助这些容器根据需要进行扩展。有了 Kubernetes 作为你的中央控制平台(或称 _control plane_),你需要一种方式来管理 Kubernetes而这项工作的工具就是 kubectl。`kubectl` 命令让你控制、维护、分析和排 Kubernetes 集群的故障。与许多使用 `ctl`(“控制”的缩写)后缀的工具一样,如 systemctl 和 sysctlkubectl 拥有大量的功能和任务权限,所以如果你正在运行 Kubernetes你最终会经常使用它。它是一个拥有众多选项的命令,所以下面是 kubectl 中简单易用的五个常见任务。
### 1\. 列出并描述资源
按照设计,容器往往会成倍增加。在某些条件下,它们可以快速增加。如果你只能通过 `podman ps``docker ps` 来查看正在运行的容器,这可能会让你不知所措。通过 `kubectl get``kubectl describe`,你可以获得关于哪些 pod 正在运行以及它们正在处理的容器的信息。更重要的是,你可以通过使用 `--namespace``name``--selector`等选项,只获得你需要的信息。
按照设计,容器往往会成倍增加。在某些条件下,它们可以快速增加。如果你只能通过 `podman ps``docker ps` 来查看正在运行的容器,这可能会让你不知所措。通过 `kubectl get``kubectl describe`,你可以列出正在运行的 pod 以及它们正在处理的容器信息。更重要的是,你可以通过使用 `--namespace``name``--selector`等选项,只列出所需信息。
`get` 子命令不仅仅对 pod 和容器有用。它有关于节点、命名空间、部署、服务和复制的信息。
`get` 子命令不仅仅对 pod 和容器有用。它有关于节点、命名空间、发布、服务和副本的信息。
### 2\. 创建资源
如果你只通过类似 OpenShift、OKD 或 Kubernetes 提供的 Web 用户界面UI创建过部署,但你想从 Linux 终端控制你的集群,那么可以使用 `kubectl create`。`kubectl create` 命令并不只是实例化一个新的应用部署。Kubernetes 中还有很多其他组件可以创建,比如服务、配额和 [CronJob][3]。
如果你只通过类似 OpenShift、OKD 或 Kubernetes 提供的 Web 用户界面UI创建过发布,但你想从 Linux 终端控制你的集群,那么可以使用 `kubectl create`。`kubectl create` 命令并不只是实例化一个新的应用发布。Kubernetes 中还有很多其他组件可以创建,比如服务、配额和 [计划任务][3]。
Kubernetes 中的 CronJob 可以创建一个临时的 pod用来在你选择的时间表上执行一些任务。它们并不难设置。下面是一个 CronJob让一个 BusyBox 镜像每分钟响应 “hello world”。
Kubernetes 中的计划任务可以创建一个临时的 pod用来在你选择的时间表上执行一些任务。它们并不难设置。下面是一个计划任务,让一个 BusyBox 镜像每分钟打印 “hello world”。
```
@ -36,7 +36,7 @@ hello-world \
### 3\. 编辑文件
你可能了解 Kubernetes 中的对象都有相应的配置文件,但在文件系统中查找相应的文件可能很麻烦。有了 `kubectl edit`,你可以把注意力放在对象上,而不是定义它们的文件上。你可以让 `kubectl` 为你找到并打开文件(它遵循 `KUBE_EDITOR` 环境变量,所以你可以把编辑器设置成你喜欢的)。
Kubernetes 中的对象都有相应的配置文件,但在文件系统中查找相应的文件较为麻烦。有了 `kubectl edit`,你可以把注意力放在对象上,而不是定义文件上。你可以通过 `kubectl` 找到并打开文件(关联 `KUBE_EDITOR` 环境变量,你可以设置成你喜欢的编辑器)。
```
@ -44,18 +44,18 @@ $ KUBE_EDITOR=emacs \
kubectl edit cronjob/hello-world
```
### 4\. 容器之间的交换文件
### 4\. 容器之间的传输文件
初次接触容器的人往往对他们直接无法访问的共享系统的概念感到困惑。他们可能会在容器引擎或 kubectl 中了解到 `exec` 选项,但当他们不能从容器中取文件或将文件放入容器中时,容器仍然会显得不透明。使用 `kubectl cp` 命令,你可以把容器当做远程服务器,使复制文件到容器或从容器复制文件不比 SSH 命令更复杂
初次接触容器的人往往对无法直接访问的共享系统的概念感到困惑。他们可能会在容器引擎或 kubectl 中了解到 `exec` 选项,但当他们不能从容器中取文件或将文件放入容器中时,容器仍然会显得不透明。使用 `kubectl cp` 命令,你可以把容器当做远程服务器,使主机和容器之间文件传输如 SSH 命令一样简单
```
`$ kubectl cp foo my-pod:/tmp`
```
### 5\. 应用更
### 5\. 应用
对 Kubernetes 对象进行修改,可以在任何时候通过 `kubectl apply` 命令完成。你所要做的就是将该命令指向一个配置文件:
对 Kubernetes 对象进行修改,可以通过 `kubectl apply` 命令完成。你所要做的就是将该命令指向一个配置文件:
```
@ -73,7 +73,7 @@ $ kubectl apply -n argocd \
### 使用 kubectl
Kubectl 是一个强大的工具,由于它是一个终端命令,它可以写成脚本,并以许多 Web UI 无法实现的方式使用。学习 kubectl 是进一步了解 Kubernetes、容器、pod 以及围绕这些重要的云计算创新的所有技术的一个好方法。[下载我们的 kubectl 速查表][5],以获得快速参考,其中包括命令示例,以帮助你学习,并在你成为专家后提醒你注意细节。
Kubectl 是一个强大的工具,由于它是一个终端命令,它可以写成脚本,并能实现用众多 Web UI 无法实现的功能。学习 kubectl 是进一步了解 Kubernetes、容器、pod 以及围绕这些重要的云计算创新技术的一个好方法。[下载我们的 kubectl 速查表][5],以获得快速参考,其中包括命令示例,以帮助你学习,并在为你提供注意细节。
--------------------------------------------------------------------------------
@ -82,7 +82,7 @@ via: https://opensource.com/article/21/7/kubectl
作者:[Alan Smithee][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -7,24 +7,24 @@
[#]: publisher: ( )
[#]: url: ( )
4 cool new projects to try in Copr from July 2021
COPR 仓库中 4 个很酷的新项目2021.07
======
![][1]
Copr is a [collection][2] of personal repositories for software that isnt carried in Fedora Linux. Some software doesnt conform to standards that allow easy packaging. Or it may not meet other Fedora Linux standards, despite being free and open-source. Copr can offer these projects outside the Fedora Linux set of packages. Software in Copr isnt supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software.
COPR 是个人软件仓库[集合][2],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准;或者它可能不符合其他 Fedora 标准尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。
This article presents a few new and interesting projects in Copr. If youre new to using Copr, see the [Copr User Documentation][3] for how to get started.
本文介绍了 COPR 中一些有趣的新项目。如果你第一次使用 COPR请参阅 [COPR 用户文档][3]。
## [][4] Wike
[Wike][5] is a Wikipedia reader for the GNOME Desktop with search integration in the GNOME Shell. It provides distraction-free access to the [online encyclopedia][6]. The interface is minimalistic but it supports switching an article between multiple languages, bookmarks, article table of contents, dark mode, and more.
[Wike][5] 是一个用于 GNOME 桌面的维基百科阅读器,在 GNOME Shell 中集成了搜索功能。它提供了对[在线百科全书][6]的无干扰访问。它的界面很简约,但它支持在多种语言之间切换文章、书签、文章目录、黑暗模式等。
![][7]
### [][8] Installation instructions
### [][8] 安装说明
The [repo][9] currently provides Wike for Fedora 33, 34, and Fedora Rawhide. To install it, use these commands:
该[仓库]][9]目前在 Fedora 33、34 和 Fedora Rawhide 提供 Wike。要安装它请使用这些命令
```
sudo dnf copr enable xfgusta/wike
@ -33,20 +33,20 @@ sudo dnf install wike
## [][10] DroidCam
We are living through confusing times, being isolated at our homes, and the majority of our interactions with friends and coworkers take place on some video conference platform. Dont waste your money on an overpriced webcam if you carry one in your pocket already. [DroidCam][11] lets you pair your phone with a computer and use it as a dedicated webcam. The connection made through a USB cable or over WiFi. DroidCam provides remote control of the camera and allows zooming, using autofocus, toggling the LED light, and other convenient features.
我们正生活在一个混乱的时代,被隔离在家中,我们与朋友和同事的大部分互动都发生在一些视频会议平台上。如果你已经有一部手机,就不要把钱浪费在价格过高的网络摄像头上。[DroidCam][11] 让你将手机与电脑配对,并将其作为专用网络摄像头使用。通过 USB 线或通过 WiFi 进行连接。DroidCam 提供对摄像头的远程控制,并允许缩放、使用自动对焦、切换 LED 灯和其他便利功能。
![][12]
### [][13] Installation instructions
### [][13] 安装说明
The [repo][14] currently provides DroidCam for Fedora 33 and 34. Before installing it, please update your system and reboot, or make sure you are running the latest kernel version and have an appropriate version of _kernel-headers_ installed.
该[仓库][14]目前为在 Fedora 33 和 34 中提供 DroidCam。在安装之前请更新你的系统并重新启动或者确保你运行的是最新的内核版本并安装了适当版本的 _kernel-headers_
```
sudo dnf update
sudo reboot
```
Droidcam depends on _v4l2loopback_ which must be installed manually from the [RPM Fusion Free repository][15].
Droidcam 依赖 _v4l2loopback_,必须从 [RPM Fusion 免费仓库][15]手动安装。
```
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
@ -54,7 +54,7 @@ sudo dnf install v4l2loopback
sudo modprobe v4l2loopback
```
Now install the _droidcam_ package:
现在安装 _droidcam_ 软件包:
```
sudo dnf copr enable meeuw/droidcam
@ -63,17 +63,17 @@ sudo dnf install droidcam
## [][16] Nyxt
[Nyxt][17] is a keyboard-oriented, infinitely extensible web browser designed for power users. It was heavily inspired by Emacs and as such is implemented and configured in Common Lisp providing familiar key-bindings ([Emacs][18], [vi][19], [CUA][20]).
[Nyxt][17] 是一个面向键盘、可无限扩展的网络浏览器,专为高级用户设计。它在很大程度上受到 Emacs 的启发,因此用 Common Lisp 实现和配置,提供熟悉的按键绑定([Emacs][18]、[vi][19]、[CUA][20])。
Other killer features that cannot be missed are a built-in REPL, [tree history][21], [buffers instead of tabs][22], and [so much more][17].
其他不能错过的杀手锏是一个内置的 REPL、[树形历史][21]、[缓冲区代替标签][22],还有[更多][17]。
Nyxt is web engine agnostic so dont worry about pages rendering in unexpected ways.
Nyxt 与网络引擎无关,所以不用担心页面会以意外的方式呈现。
![][23]
### [][24] Installation instructions
### [][24] 安装说明
The [repo][25] currently provides Nyxt for Fedora 33, 34, and Fedora Rawhide. To install it, use these commands:
该[仓库][25]目前为 Fedora 33、34 和 Fedora Rawhide 提供 Nyxt。要安装它请使用这些命令
```
sudo dnf copr enable teervo/nyxt
@ -82,22 +82,22 @@ sudo dnf install nyxt
## [][26] Bottom
[Bottom][27] is a system monitor with a customizable interface and multitude of features, It took inspiration from [gtop][28], [gotop][29], and [htop][30]. As such, it supports [processes][31] monitoring, [CPU][32], [RAM][33], and [network][34] usage monitoring. Besides those, it also provides more exotic widgets such as [disk capacity][35] usage, [temperature sensors][36], and [battery][37] usage.
[Bottom][27] 是一个具有可定制界面和多种功能的系统监控器,它从 [gtop][28]、[gotop][29] 和 [htop][30] 获得灵感。因此,它支持[进程][31]监控、[CPU][32]、[RAM][33]和[网络][34]使用监控。除了这些,它还提供了更多奇特的小部件,如[磁盘容量][35]使用情况,[温度传感器][36],和[电池][37]使用情况。
Bottom utilizes the screen estate very efficiently thanks to the customizable layout of widgets as well as the [possibility to focus on just one widget and maximizing it][38].
由于小部件的可自定义布局以及[可以只关注一个小部件并最大化它][38]Bottom 可以非常有效地利用屏幕空间。
![][39]
### [][40] Installation instructions
### [][40] 安装说明
The [repo][41] currently provides Bottom for Fedora 33, 34, and Fedora Rawhide. It is also available for EPEL 7 and 8. To install it, use these commands:
该[仓库][41]提供为 Fedora 33、34 和 Fedora Rawhide 提供 Bottom。它也可用于 EPEL 7 和 8。要安装它请使用这些命令
```
sudo dnf copr enable opuk/bottom
sudo dnf install bottom
```
Use _btm_ command to run the program.
使用 _btm_ 命令来运行该程序。
--------------------------------------------------------------------------------
@ -105,7 +105,7 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-july-2021
作者:[Jakub Kadlčík][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,53 @@
[#]: subject: (Use the Linux terminal to navigate throughout your computer)
[#]: via: (https://opensource.com/article/21/8/navigate-linux-directories)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
使用 Linux 终端浏览你的计算机
======
学习在 Linux 终端中从一个目录切换到另一个目录。
![Move around your computer][1]
要在图形界面中浏览你的计算机上的文件夹,你可能习惯于打开一个窗口来“进入”你的计算机,然后双击一个文件夹,再双击一个子文件夹,如此反复。你也可以使用箭头按钮或按键来回溯。
而要在终端中浏览你的计算机,你可以利用 **cd** 命令。你可以使用 **cd ..** 回到 _上一级_ 目录,或者使用 **cd ./另一个/文件夹的/路径** 来跳过许多文件夹进入一个特定的位置。
你在互联网上已经使用的 URL 的概念,实际上直接来自 [POSIX][2]。当你浏览某个网站的一个特定页面时,比如 `http://www.example.com/tutorials/lesson2.html`,你实际上做的是进入 `/var/www/imaginarysite/tutorials/` 目录,并打开一个叫 `classic2.html` 的文件。当然,你是在网络浏览器中打开它的,浏览器会将所有那些看起来奇怪的 HTML 代码解释成漂亮的文本和图片。但这两者的思路是完全一样的。
如果你把你的计算机看成是互联网(或者把互联网看成是计算机会更合适),那么你就能理解如何在你的文件夹和文件中遨游了。如果从你的用户文件夹(你的家目录,或简记为 `~`)开始,那么你想切换到的文件夹都是相对于这个文件夹而言的:
```
$ cd ~/Documents
$ pwd
/home/tux/Documents
$ cd ..
$ pwd
/home/tux
```
这需要一些练习,但一段时间后,它会变得比你打开和关闭窗口、点击返回按钮和文件夹图标快得多。
### 用 Tab 键自动补全
键盘上的 **Tab** 键可以自动补全你开始输入的文件夹和文件的名字。如果你要 **cd**`~/Documents` 文件夹,那么你只需要输入 `cd ~/Doc`,然后按 **Tab** 键即可。你的 Shell 会自动补全 `uments`。这不仅仅是一个令人愉快的便利工具,它也是一种防止错误的方法。如果你按下 **Tab** 键而没有任何东西自动补全,那么可能你 _认为_ 存在于某个位置的文件或文件件实际上并不存在。即使有经验的 Linux 用户也会试图切换到一个当前目录下不存在的文件夹,所以你可以经常使用 **pwd****ls** 命令来确认你确实在你认为你在的目录、以及你的当前目录确实包含了你认为它包含的文件。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/navigate-linux-directories
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01s04.svg_.png?itok=bC8Bcapk (Move around your computer)
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains

View File

@ -0,0 +1,52 @@
[#]: subject: (Move files in the Linux terminal)
[#]: via: (https://opensource.com/article/21/8/move-files-linux)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
在 Linux 终端中移动文件
======
使用 mv 命令将一个文件从一个位置移动到另一个位置。
![Moving files][1]
要在有图形界面的计算机上移动一个文件,你要打开该文件当前所在的文件夹,然后打开另一个窗口到你想把文件移到的文件夹。最后,你把文件从一个窗口拖到另一个窗口。
要在终端中移动文件,你可以使用 **mv** 命令将文件从一个位置移动到另一个位置。
```
$ mv example.txt ~/Documents
$ ls ~/Documents
example.txt
```
在这个例子中,你已经把 **example.txt** 从当前文件夹移到了 **Documents** 文件夹中。
只要你知道一个文件在__哪里__又想把它移到_哪里_去你就可以把文件从任何地方移动到任何地方而不管你在哪里。与在一系列窗口中浏览你电脑上的所有文件夹以找到一个文件然后打开一个新窗口到你想让该文件去的地方再拖动该文件相比这可以大大节省时间。
默认情况下,**mv** 命令完全按照它被告知的那样做:它将一个文件从一个位置移动到另一个位置。如果在目标位置已经存在一个同名的文件,它将被覆盖。为了防止文件在没有警告的情况下被覆盖,请使用 **\--interactive**(或简写 **-i**)选项。
```
$ mv -i example.txt ~/Documents
mv: overwrite '/home/tux/Documents/example.txt'?
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/move-files-linux
作者:[Seth Kenlon][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://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01s05.svg_.png?itok=PgKQEDZ7 (Moving files)

View File

@ -0,0 +1,102 @@
[#]: subject: "How to Install Java on Fedora Linux"
[#]: via: "https://itsfoss.com/install-java-fedora/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Fedora Linux 上安装 Java
======
不管是爱它还是恨它,都很难避开 Java。
Java 仍然是一种非常流行的编程语言,在学校里教,在企业里用。
如果你想使用基于 Java 的工具或用 Java 编程,你就需要在你的系统上安装 Java。
这就变得很混乱,因为围绕着 Java 有很多技术术语。
* Java 开发工具包JDK用于创建 Java 程序
* Java 运行环境JRE或 Java 虚拟机JVM用于运行 Java 程序。
除此之外,你还会遇到 [OpenJDK][1] 和 [Oracle Java SE][2]。OpenJDK 是被推荐的,因为它是开源的。如果你有专门的需求,那么你只应该选择 Oracle Java SE。
这里还有一件事。即使是 OpenJDK 也有几个版本可供选择。在写这篇文章的时候Fedora 34 有 OpenJDK 1.8、OpenJDK 11 和 OpenJDK 16 可用。
你可以自行决定想要哪个Java版本。
### 在 Fedora Linux 上安装 Java
首先,检查是否已经安装了 Java以及它是哪个版本。我不是在开玩笑。Fedora 通常预装了 Java。
要检查它,请使用以下命令:
```
java -version
```
正如你在下面的截图中看到的,我的 Fedora 系统上安装了 Java 11OpenJDK 11
![Check Java version][3]
假设你想安装另一个版本的 Java。你可以用下面的命令检查可用的选项
```
sudo dnf search openjdk
```
这里的sudo不是必须的但它会刷新 sudo 用户的元数据,这在你安装另一个版本的 Java 时会有帮助。
上面的命令将显示很多输出,其中有很多看起来相似的软件包。你必须专注于最初的几个词来理解不同的版本。
![Available Java versions in Fedora][4]
例如,要安装 Java 8 (OpenJDK 1.8),包的名字应该是 java-1.8.0-openjdk.x86_64 或者 java-1.8.0-openjdk。用它来安装
```
sudo dnf install java-1.8.0-openjdk.x86_64
```
![Install Java Fedora][5]
这就好了。现在你的系统上同时安装了 Java 11 和 Java 8。但你将如何使用其中一个呢
#### 在 Fedora 上切换 Java 版本
你正在使用的 Java 版本保持不变,除非你明确改变它。使用这个命令来列出系统上安装的 Java 版本:
```
sudo alternatives --config java
```
你会注意到在 Java 版本前有一个数字。Java 版本前的 + 号表示当前正在使用的 Java 版本。
你可以指定这个数字来切换 Java 版本。因此,在下面的例子中,如果我输入 2它将把系统中的 Java 版本从 Java 11 改为 Java 8。
![Switching between installed Java versions][6]
这就是你在 Fedora 上安装 Java 所需要做的一切。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-java-fedora/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://openjdk.java.net/
[2]: https://www.oracle.com/java/technologies/javase-downloads.html
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/check-java-version-fedora.png?resize=800%2C271&ssl=1
[4]: https://itsfoss.com/wp-content/uploads/2021/08/available-java-versions-fedora-800x366.webp
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/install-java-fedora.png?resize=800%2C366&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/switch-java-versions-fedora.png?resize=800%2C513&ssl=1