Merge pull request #5 from LCTT/master

Update from LCTT
This commit is contained in:
perfiffer 2021-08-09 22:06:16 +08:00 committed by GitHub
commit 968e82af3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1929 additions and 877 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,17 +3,20 @@
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (imgradeone)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13653-1.html)
Windows 11 的外观受到了 KDE Plasma 和 GNOME 的启发?
Windows 11 的外观受到了 KDE Plasma 和 GNOME 的启发
======
> 微软即将发布的 Windows 11 操作系统的图像与我们所心爱的 KDE Plasma 和 GNOME 有许多相似之处。它们到底有多相似呢?我们试着比较了一下。
我曾记得一句俗话 —— _Good artists copy. Great artists steal_。我不知道 Windows 11 背后的设计团队,但他们似乎很大程度上受到了 Linux 桌面的影响。如果你回顾近几年来的 Windows 系统外观 —— 从 Windows XP 到 7再到 10 —— 整体视觉上都没有什么太大的变化,直到今天为止
> 截图显示,微软即将发布的 Windows 11 操作系统与我们所心爱的 KDE Plasma 和 GNOME 有许多相似之处。它们到底有多相似呢?我们试着比较了一下
Windows 操作系统的新版本通常有 5 到 7 年的生命周期。如果你试着回想 Windows 提供给你的个性化选项,你会发现这些选项近几年来基本都是一致的,甚至是桌面整体的体验 —— 包括开始菜单位置、宽度、颜色 —— 一切都没变过。
![](https://img.linux.net.cn/data/attachment/album/202108/06/103308cfoo3xoz2c002hx2.jpg)
我曾记得一句俗话 —— “<ruby>优秀者模仿,伟大者剽窃<rt>Good artists copy. Great artists steal</rt></ruby>”。我不认识 Windows 11 背后的设计团队,但他们似乎很大程度上受到了 Linux 桌面的影响。如果你回顾近几年来的 Windows 系统外观 —— 从 Windows XP 到 7再到 10 —— 整体视觉上都没有什么太大的变化,直到今天为止。
Windows 操作系统的新版本通常有 5 到 7 年的生命周期。如果你试着回想 Windows 提供给你的个性化选项,你会发现这些选项近几年来基本都是一致的,甚至包括开始菜单位置、宽度、颜色在内的桌面整体的体验,一切都没变过。
但随着 Windows 11 的全新外观,这一点终于改变了。让我带你看一些我之前所见过的截图,并且分析一下,它们到底和流行的 Linux [桌面环境][1](如 KDE Plasma 和 GNOME有多相似。
@ -21,15 +24,15 @@ Windows 操作系统的新版本通常有 5 到 7 年的生命周期。如果你
#### 开始菜单和任务栏
传统的开始菜单和任务栏主题在 Windows 11 上有所变化。开始菜单和任务栏图标(默认情况下)位于任务栏中央。Windows 也在设置中提供了将任务栏图标和开始菜单移回左侧的选项。
传统的开始菜单和任务栏主题在 Windows 11 上有所变化。开始菜单和任务栏图标位于任务栏中央(默认视图)。Windows 也在设置中提供了将任务栏图标和开始菜单移回左侧的选项。
![Windows 11 浅色模式下的开始菜单][2]
整体的布局方式和默认图标的色彩让我想起了 KDE Plasma 的任务栏和启动器。这些图标带有抛光,并且居中,给人带来类似 GNOME 上 Adwaita 图标的观感,而任务栏就更像是 KDE Plasma 的任务栏。
整体的布局方式和默认图标的色彩让我想起了 KDE Plasma 的任务栏和启动器。这些图标很精致,并且居中,给你带来一种类似 GNOME 上 Adwaita 图标的观感,而任务栏就更像是 KDE Plasma 的任务栏。
当你打开开始菜单后,它为你提供不同的图标和选项的排列方式。此外,当你开始打字时,顶部的搜索选项就会弹出。
现在,来看看全新设计的 KDE Plasma 启动器。我知道间距、图标大小和度并不完全一致,但你可以看到,两者看起来有多么惊人的相似。
现在,来看看全新设计的 KDE Plasma 启动器。我知道间距、图标大小和清晰度并不完全一致,但你可以看到,两者看起来有多么惊人的相似。
![KDE Plasma 5.22 亮色模式下的启动器][3]
@ -39,7 +42,7 @@ Windows 操作系统的新版本通常有 5 到 7 年的生命周期。如果你
#### 窗口装饰
按照传统GNOME 总是用圆角作为标准的窗口装饰。作为对照Windows 则一直采用直角作为窗口装饰 —— 似乎一直都这样,直到现在为止。嗯,在 Windows 11 中,所有窗口装饰都是看上去不错的圆角。圆角的概念不是什么版权专利或者新想法,这就有一个问题了,为什么现在全都在用圆角?是有什么隐藏的目的吗?
按照传统GNOME 总是用圆角作为标准的窗口装饰。作为对照Windows 则一直采用直角作为窗口装饰 —— 似乎一直都这样,直到现在为止。嗯,在 Windows 11 中,所有窗口装饰都是圆角,看起来很好。圆角的概念不是什么版权专利或者新想法,这就有一个问题了,为什么现在全都在用圆角?是有什么隐藏的目的吗?
![Windows 资源管理器和 Nautilus 的圆角][6]
@ -49,9 +52,7 @@ Windows 操作系统的新版本通常有 5 到 7 年的生命周期。如果你
#### 调色盘
Windows 多年来始终有基于“蓝色”或其他蓝色变体的主题。虽然用户可以自行更改任务栏、开始菜单背景、窗口标题栏颜色的选项,但借助这个选项,调色板与亮暗模式结合,展示出巨大变化,给 Windows 桌面带来了更圆滑、迷人的外观。也许这个灵感源自 Ubuntu、KDE 或者其它风格的调色板。
另见:[Windows 11 系统要求让人“回首瞻望”。是时候迁移至 Linux 了?][8]
Windows 多年来始终有基于“蓝色”或其他蓝色变体的主题。虽然用户可以自行更改任务栏、开始菜单背景、窗口标题栏颜色,但借助这个选项,调色板与亮暗模式结合,展示出巨大变化,给 Windows 桌面带来了更圆滑、迷人的外观。也许这个灵感源自 Ubuntu、KDE 或者其它风格的调色板。
#### 暗黑模式
@ -67,22 +68,20 @@ Windows 11 首次官方支持了暗黑模式,或者说是暗色主题。那么
这些只是吸引我眼球的冰山一角。也许 Windows 11 还有许多“灵感”来“启发”它的外观。
但问题来了 —— 为什么现在反而是介绍这些功能和外观的最佳时机?
但问题来了 —— 为什么现在是一次推出这些功能和外观的最佳时机?
### 尾注
### 结束语
实话实说,当我第一次看到 Windows 11 的新外观时,我脑袋里就浮现出 Breeze Dark 主题的 KDE Plasma。借助很少量的修改你可以让 KDE Plasma 看上去像 Windows 11。这本身就说明了它们两者是有多么地相似。
如果你看向整个桌面操作系统的市场,唯独有 Windows、Linux 桌面和 macOS 是竞争者。至今为止,它们的外观都有明显的标志性特征,例如 macOS 有自己独一无二的外观。目前为止Windows 也有一样的,蓝色主题的常规开始菜单等等。但借助这些新变化Windows 为用户提供了更丰富的定制选项,让它看上去更像 Linux 桌面。
如果你看向整个桌面操作系统的市场,竞争者只有 Windows、Linux 桌面和 macOS。至今为止,它们的外观都有明显的标志性特征,例如 macOS 有自己独一无二的外观。直到现在Windows 也有一样的蓝色主题的常规开始菜单等等。但借助这些新变化Windows 为用户提供了更丰富的定制选项,让它看上去更像 Linux 桌面。
在我个人看来Windows 团队需要一种不同的标志性特征,而不是一直从我们心爱的 Linux 桌面获得“启发”。
我不知道未来会发生什么但现在看来“E-E-E”还在竭尽全力运作。
我不知道未来会发生什么但现在看来“E-E-E” 还在竭尽全力运作。LCTT 译注“E-E-E”是微软臭名昭著的<ruby>拥抱、扩展再消灭<rt>Embrace, extend, and extinguish</rt></ruby>策略。)
再会。
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/windows-11-inspiration-linux-kde-plasma/
@ -90,7 +89,7 @@ via: https://www.debugpoint.com/2021/06/windows-11-inspiration-linux-kde-plasma/
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[imgradeone](https://github.com/imgradeone)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -4,19 +4,20 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (turbokernel)
[#]: publisher: ( )
[#]: url: ( )
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13656-1.html)
使用 du 检查 Linux 上已用的磁盘空间
======
用 Linux 的 du 命令了解你正在使用多少磁盘空间。
![Check disk usage][1]
> 用 Linux 的 du 命令了解你正在使用多少磁盘空间。
![](https://img.linux.net.cn/data/attachment/album/202108/06/200731j561cwxyxyekaic5.jpg)
无论你有多少存储空间,它总有可能被填满。在大多数个人设备上,磁盘被照片、视频和音乐填满,但在服务器上,由于用户账户和日志文件数据,空间减少是很正常的。无论你是负责管理一个多用户系统,还是只负责自己的笔记本电脑,你都可以用 `du` 命令检查磁盘的使用情况。
默认情况下,`du` 列出了当前目录中使用的磁盘空间,以及每个子目录的大小。
```
$ du
12 ./.backups
@ -25,8 +26,7 @@ $ du
在这个例子中,当前目录总共占用了 60KB其中 12KB 被子目录 `.backups` 占用。
如果你觉得这很混乱,并希望分别看到所有的大小,你可以使用 `--separate-dirs`(或简写 `S`)选项:
如果你觉得这很混乱,并希望分别看到所有的大小,你可以使用 `--separate-dirs`(或简写 `-S`)选项:
```
$ du --separate-dirs
@ -36,8 +36,7 @@ $ du --separate-dirs
显示相同的信息48KB 加 12KB 是 60KB但每个目录被独立处理。
如需看到更多的细节,可以使用 --all简写 -a选项它显示每个目录中以及每个文件
如需看到更多的细节,可以使用 `--all`(简写 `-a`)选项,它显示每个目录中以及每个文件:
```
$ du --separate-dirs --all
@ -52,10 +51,9 @@ $ du --separate-dirs --all
### 查看文件的修改时间
当查看文件以找出占用空间的内容时,查看文件最后一次被修改的时间是很有用的。一年内没有使用的文件很可能是归档的候选文件,特别是当你的空间快用完时。
通过 du 查看文件的修改时间,使用 `--time` 选项:
当查看文件以找出占用空间的内容时,查看文件最后一次被修改的时间是很有用的。一年内没有使用过的文件可以考虑归档,特别是当你的空间快用完时。
通过 `du` 查看文件的修改时间,使用 `--time` 选项:
```
$ du --separate-dirs --all --time
@ -70,7 +68,6 @@ $ du --separate-dirs --all --time
当为了磁盘空间而查看文件时,你可能只关心较大的文件。你可以通过 `--threshold`(简写 `-t`)选项为文件大小设置一个阈值。例如,只查看大于 1GB 的文件:
```
$ \du --separate-dirs --all --time --threshold=1G ~/Footage/
1839008 2021-07-14 13:55 /home/tux/Footage/snowfall.mp4
@ -80,10 +77,8 @@ $ \du --separate-dirs --all --time --threshold=1G ~/Footage/
当文件较大时,它们可能难以阅读。使用 `--human-readable`(简写 `-h`)选项可以使文件大小更容易阅读:
```
$ \du --separate-dirs --all --time \
\--threshold=1G --human-readable ~/Footage/
$ du --separate-dirs --all --time --threshold=1G --human-readable ~/Footage/
1.8G 2021-07-14 13:55 /home/tux/Footage/snowfall.mp4
1.6G 2020-04-11 13:10 /home/tux/Footage/waterfall.mp4
8.5G 2021-07-14 13:55 /home/tux/Footage/

View File

@ -3,28 +3,28 @@
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13655-1.html)
如何在 elementary OS 中改变锁定和登录屏幕的壁纸
======
本教程解释了在 elementary OS 中改变锁定和登录屏幕背景的步骤。这将取代默认的灰色背景。
在 elementary OS 中改变锁屏或登录屏背景的灰色默认壁纸是有点困难的。典型的用图像文件的路径改变 greeter 配置是行不通的
> 本教程解释了在 elementary OS 中改变锁定和登录屏幕背景的步骤。这将取代默认的灰色背景
不幸的是,这不是一个更简单的解决方案,因为灰色背景是一个图像文件,它的数据在 greeter 中是硬编码的,需要用新的图像重新编译才能使其发挥作用
在 elementary OS 中改变锁屏或登录屏背景的灰色默认壁纸是有点困难的。典型的用图像文件的路径改变 `greeter` 的配置是行不通的
下面是方法。
不幸的是,这不是一个更简单的解决方案,因为灰色背景是一个图像文件,它的数据是硬编码在 `greeter` 中的,需要用新的图像重新编译才能使其发挥作用。
下面是方法:
![Lock / Login screen background elementary OS \(Odin\)][1]
### 改变 elementary OS 锁定和登录屏幕背景
* 在 elementary OS 中打开一个终端。
* 为 [greeter包][2]安装 git 和以下依赖项。
在 elementary OS 中打开一个终端。
为 [greeter 包][2]安装 git 和以下依赖项:
```
sudo apt install git
@ -34,24 +34,18 @@ sudo apt install git
sudo apt install -y gnome-settings-daemon libaccountsservice-dev libgdk-pixbuf2.0-dev libgranite-dev libgtk-3-dev libhandy-1-dev liblightdm-gobject-1-dev libmutter-6-dev libwingpanel-dev libx11-dev meson valac
```
* 进入临时的 /tmp 目录,从 GitHub 克隆最新的 greeter 主分支。
进入临时的 `/tmp` 目录,从 GitHub 克隆最新的 greeter 主分支:
```
cd /tmp
git clone https://github.com/elementary/greeter.git
```
* 克隆完成后,在文件管理器中打开路径 `/tmp/greeter/data`
* 初级操作系统使用一个 100×100px 的 PNG 文件作为登录屏幕/锁屏的默认背景。该图像是平铺的,给人一种灰色背景的感觉。
* 用 `texture.png` 重命名你想要的墙纸图像,并在路径中覆盖以下文件。
克隆完成后,在文件管理器中打开路径 `/tmp/greeter/data`
elementary OS 使用一个 100×100px 的 PNG 文件作为登录屏幕/锁屏的默认背景。该图像是平铺的,给人一种灰色背景的感觉。
`texture.png` 重命名你想要的墙纸图像,并在路径中覆盖以下文件:
![gray background is created using this file][3]
@ -59,9 +53,7 @@ git clone https://github.com/elementary/greeter.git
/tmp/greeter/data/texture.png
```
* 在文本编辑器中打开文件 `/tmp/greeter/compositor/SystemBackground.vala`,并替换下面一行:
在文本编辑器中打开文件 `/tmp/greeter/compositor/SystemBackground.vala`,并替换下面一行:
![change the path of image][4]
@ -75,12 +67,10 @@ resource:///io/elementary/desktop/gala/texture.png
resource:///io/elementary/greeter/texture.png
```
* 保存该文件。
* 再次打开终端,使用以下命令构建 `greeter`
保存该文件。
再次打开终端,使用以下命令构建 `greeter`
```
cd /tmp/greeter
@ -90,10 +80,9 @@ sudo ninja install -C _build
![building greeter][5]
* 如果你遇到任何构建错误,请在下面的评论中告诉我。你应该不会看到任何错误,因为我已经测试过了。
如果你遇到任何构建错误,请在下面的评论中告诉我。你应该不会看到任何错误,因为我已经测试过了。
上面的命令完成后,你可以在测试模式下运行 lightdm 来测试登录屏:
上面的命令完成后,你可以在测试模式下运行 `lightdm` 来测试登录屏:
```
lightdm --test-mode --debug
@ -116,7 +105,7 @@ via: https://www.debugpoint.com/2021/07/change-lock-login-screen-background-elem
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,13 +3,15 @@
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13659-1.html)
如何在 Linux Mint 上安装 Google Chrome(初学者技巧)
初级:如何在 Linux Mint 上安装 Google Chrome
======
![](https://img.linux.net.cn/data/attachment/album/202108/08/133301ni5k5i8rziezwe5i.jpg)
这应该是一个非常简单的话题,但我写这个是因为我看到很多网站推荐在 Linux Mint 上安装 Google Chrome 的奇怪命令行步骤。那是可行的,但那是不必要的复杂,特别是对于不熟悉命令行的初学者。
实际上,你根本不需要走终端方式。你所要做的就是去谷歌浏览器的网站,下载 Ubuntu 的安装文件并安装。
@ -30,7 +32,7 @@
![Select Debian/Ubuntu option for Chrome package on Mint][3]
在开始下载之前Firefox 会询问你是否要用 Gdebi 打开下载的文件或保存它。你可以选择任何一个选项,因为最终你会[使用 Gdebi 来安装 deb 文件][4]。然而,我更喜欢先保存文件。
在开始下载之前Firefox 会询问你是否要用 Gdebi 打开下载的文件或保存它。你可以选择任何一个选项,因为最终你会 [使用 Gdebi 来安装 deb 文件][4]。然而,我更喜欢先保存文件。
![Save the deb file][5]
@ -38,7 +40,7 @@
![Wait for Google Chrome download to finish][6]
下载完成后,在文件管理器中进入下载文件夹。要[安装 deb 文件][7],可以双击它或者右击它并选择 “Open With GDebi Package Installer”。
下载完成后,在文件管理器中进入下载文件夹。要 [安装 deb 文件][7],可以双击它或者右击它并选择 “Open With GDebi Package Installer”。
![Double click on the downloaded deb file to install it][8]
@ -101,7 +103,7 @@ via: https://itsfoss.com/install-chrome-linux-mint/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者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,112 @@
[#]: subject: "Firefox Lost Almost 50 million Users: Heres Why It is Concerning"
[#]: via: "https://news.itsfoss.com/firefox-decline/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "imgradeone"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13658-1.html"
Firefox 失去了近 5000 万用户:令人担忧的原因
======
> 2018 年以来Mozilla 的火狐浏览器正在大面积流失用户,为什么用户正在远离它?这是否值得担心?
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/firefox-decline.jpg?w=1200&ssl=1)
Mozilla 的 Firefox 是基于 Chromium 内核的浏览器的唯一流行替代品。
它一直是 Linux 用户,以及每个平台上注重隐私的用户的默认选择。
然而,即便凭借着大量优势成为最好的 Web 浏览器之一Firefox 近几年逐渐流失了它的影响力。
实话实说,我们都不需要借助统计数据来论证这一点,因为我们当中的许多人就已经转向其它 Chromium 内核的浏览器,或者 Chromium 本身,而不是 Firefox 和 Google Chrome。
不过,我在 Reddit 上偶然发现了由 [u/nixcraft][1] 写的一篇帖子,这篇帖子强调了 Firefox 的用户数从 2018 年来不断下降的原因。
而令人惊讶的是,这篇帖子的原始信息来源就是 [Firefox 的公开数据报表][2]。
![][3]
根据官方数据统计,在 2018 年底,其报告的(月度)活跃人数达到了 **2.44 亿**
但,到了 **2021 年第二季度**,这个数字降到了 **1.98 亿**
由此可以得出Firefox 的用户基数下降了高达 **4600 万**
### Firefox 的衰落确实令人担忧,但也很明显
鉴于在 2021 年以隐私为重点的工具在其用户群体中大量出现Mozilla 的 Firefox 用户基数正面临着不断下降。
尤其是在 Firefox 设法引入一些业界首创的隐私功能之后。呵,是不是很讽刺?
如果你从来没有使用过 Firefox或者已经迁移至其他浏览器许久这篇 [关于 Brave 和 Firefox 浏览器的比较][4] 表明到目前为止Firefox 其实还是一个可靠的浏览器。
所以,为什么许多用户迁移到了 Chromium 内核的浏览器,尤其是 Chrome 呢?
我这里马上就想到了这几点:
* Google Chrome 是 Android 设备上的默认浏览器
* Microsoft Edge 是 Windows 设备上的默认浏览器(因此自然就有巨大的市场份额)
* Google.com最大的搜索引擎建议用户安装 Google Chrome实际上是一种潜在的反竞争手段
* 一些 Web 服务只兼容基于 Chromium 的浏览器
除此之外Firefox 可能也做错了这几件事:
* 不断以大修的方式来破坏用户体验
* 近年来缺乏显著的性能改进
当然,没有哪个浏览器是完美的,但这是什么值得担心的事吗?嗯,我觉得是的。
### 为什么你应该担忧
Mozilla 的 Firefox 是基于 Chromium 的浏览器的唯一可行的竞争品。如果 Firefox 消失了,用户就会失去其它浏览器内核的选择。
我相信你会同意,纵容垄断是有害的,因此我们需要一些 Google Chromium 引擎的替代品。
实际上,相当多的网站会根据基于 Chromium 的浏览器来优化用户体验。
因此,如果用户量下降的趋势一直持续下去,**我们这样的用户可能就会被迫适应新的工作流程而改用其他浏览器**。
即使忽略掉 Google 的 Chromium 引擎在互联网的主导地位,或者认为 Chrome 之类的浏览器在技术上更好Firefox 仍旧十分珍贵。因为它至少提供了更多的个性化功能,也不断改进隐私体验,与其他的都不一样。
换句话说,我们可能会(被迫)失去许多好的东西,而这一切仅仅是因为其他竞争对手都选择基于 Chromium 内核,或者从事反竞争活动。
也许,你现在对 Firefox 很失望而想转向其他浏览器。当然,这是你自己的选择。
**但是,待到 Firefox 因为各种使其衰落的因素而彻底消失后,你又该何去何从呢?**
![][5]
因此,为了让一切保持平衡,我认为我们应该不断反抗科技巨头的反竞争行为,并且开始使用 Mozilla Firefox不论是什么身份甚至是作为备用浏览器
当然Mozilla 也需要面对这种情况做出什么措施了。
当他们忙于添加隐私网络服务、邮件中继和其他服务集成时Mozilla 在用户体验改善方面做的并不成功。
至少,我是这么认为的。多年来,我一直使用 Firefox 作为主力浏览器,但我最终还是会偶尔转向其他浏览器,尤其是每次 Firefox 界面进行大幅度更改后。
### 你怎么看?
我很想知道你对此有何想法,以及你认为究竟是什么因素导致了 Firefox 用户数的下降。
你更喜欢将哪款浏览器作为你的主力浏览器?在评论区中告诉我吧!
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/firefox-decline/
作者:[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://www.reddit.com/user/nixcraft/
[2]: https://data.firefox.com/dashboard/user-activity
[3]: https://news.itsfoss.com/wp-content/uploads/2021/08/firefox-userbase-decline.png
[4]: https://itsfoss.com/brave-vs-firefox/
[5]: https://news.itsfoss.com/wp-content/uploads/2021/08/firefox-survive.jpg

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,75 @@
[#]: 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

@ -1,118 +0,0 @@
[#]: subject: "Firefox Lost Almost 50 million Users: Heres Why It is Concerning"
[#]: via: "https://news.itsfoss.com/firefox-decline/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "imgradeone"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Firefox Lost Almost 50 million Users: Heres Why It is Concerning
======
Mozillas Firefox is the only popular alternative to Chromium-based browsers.
It has been the default choice for Linux users and privacy-conscious users across every platform.
However, even with all benefits as one of the best web browsers around, it is losing its grip for the past few years.
To be honest, we do not even need a stat to say that, many of us have switched over to Chromium-based browsers or Chromium itself instead of Firefox or Google Chrome.
However, I came across a Reddit thread by [u/nixcraft][1], which highlighted more details on the decline in the userbase of Firefox since 2018.
And surprisingly, the original source for this information is [Firefoxs Public Data Report][2].
![][3]
As per the official stats, the reported number of active (monthly) users was about **244 million** at the end of 2018.
And, it seems to have declined to **198 million** at the end of **Q2 2021**.
So, that makes it a whopping ~**46 million** decline in the userbase.
### Firefoxs Decline is Concerning But Obvious
Considering 2021 is the year when privacy-focused tools saw a big boost in their userbase, Mozillas Firefox is looking at a constant decline.
Especially when Firefox manages to introduce some industry-first privacy practices. Quite the irony, eh?
In case you have never used Firefox or have moved away for a long time, a [comparison between Brave and Firefox][4] highlights that it is still a solid web browser choice to date.
So, why are users moving away to Chromium-based web browsers or Chrome in particular?
There are a few things that I can think of right off the bat:
* Google Chrome being the default web browser on Android
* Microsoft Edge as the default web browser for Windows (which naturally has a huge marketshare)
* Google.com (the biggest search engine) recommending users to install Google Chrome (which is potentially an anti-competitive behaviour)
* Some web services are exclusive to Chrome-based browsers
In addition to that, there are also a few things that Firefox may have done wrong:
* Constantly breaking the user experience with major overhauls
* Lack of significant performance improvements in the recent years
Of course, no web browser is perfect but is this something to worry about? Well, I think, yes.
### Heres Why You Should be Worried
Mozillas Firefox is the only viable competitor to Chromium-based browsers. If Firefox disappears, users wont have a choice to select a different browser engine.
Im sure you will agree that monopoly is bad; hence, we need something to survive as an alternative to Googles chrome engine.
In fact, a significant number of websites optimize the user experience by keeping chrome-based browsers in mind.
So, eventually, if the declining trend continues, **users like us may just be forced to switch to other browsers by adapting to new workflows**.
Even if we ignore the dominant control of Googles chrome engine on the web by arguing that it is technically better, Firefox is still something precious. Because it provides way more customizations and constantly improves its privacy practices unlike any other.
In other words, we will be losing out on a lot of good things (forcefully) just because all the competition prefers using Chromium as its base or engage in anti-competitive activities.
Maybe, youre frustrated with Firefox now and move away to something else. Thats completely your choice.
**But, how would you feel if you wont have an alternative when Firefox ceases to exist because of all the factors affecting its decline?**
![][5]
Hence, to keep things balanced, I think we should constantly oppose the anti-competitive behavior by tech giants and start using Mozilla Firefox (in whatever capacity, even as a secondary browser).
Of course, Mozilla needs to give this situation some serious attention as well.
While they are busy introducing VPN services, email relays, and other service integrations, they are not succeeding with the user experience improvements.
At least, that is what I think. Ive used Firefox as my primary browser for years now but I end up switching to other browsers once in a while, especially, after every major UI overhaul.
### What Do You Think?
Id love to know what you think about this and what seems to be affecting Firefoxs decline in the userbase.
What do you prefer to use as your primary web browser? Let me know all of it in the comments down below!
#### 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/firefox-decline/
作者:[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://www.reddit.com/user/nixcraft/
[2]: https://data.firefox.com/dashboard/user-activity
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://itsfoss.com/brave-vs-firefox/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=

View File

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

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (YungeG)
[#]: 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,386 +0,0 @@
[#]: subject: (Command line quick tips: wc, sort, sed and tr)
[#]: via: (https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/)
[#]: author: (mahesh1b https://fedoramagazine.org/author/mahesh1b/)
[#]: collector: (lujun9972)
[#]: translator: (perfiffer)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Command line quick tips: wc, sort, sed and tr
======
![][1]
Image by Ryan Lerch (CC BY-SA 4.0)
Linux distributions are great to use and they have some tricks under their sleeves which users may not be aware of. Lets have a look at some command line utilities which really come in handy when youre the guy that likes to stick with the terminal rather than using a GUI. 
We all know that using a terminal is more efficient to use the system. In case you are editing or playing with text files on a terminal then these tools will surely make your life easy.
For this article lets have a look at _wc_, _sort_, _tr_, and _sed_ commands.
## **wc**
wc is a utility whose name stands for “word count”. As the name suggests it will count the lines, words or byte count from any file. 
Lets see how it works:
```
$ wc filename
lines words characters filename
```
So in output we get the total number of newlines in the file, total number of words, total number of characters, and the filename.
To get some specific output we have to use options:
* -c To print the byte counts
* -l   To print the newline counts
* -w To print the word counts
* -m To print the character counts
### wc demo
Lets see it in action:
Here we start with a text file, _loremipsm.txt_. First, we print out the file and then use _wc_ on it.
```
$ cat loremipsm.txt
Linux is the best-known and most-used open source operating system.
As an operating system, Linux is software that sits underneath all of the other software on a computer,
receiving requests from those programs and replaying these requests to the computer's hardware.
$ wc loremipsm.txt
3 41 268 loremipsm.txt
```
Suppose I only want to see the byte count of the file: 
```
$ wc -c loremipsm.txt
268 loremipsm.txt
```
For the newline count of the file:
```
$ wc -l loremipsm.txt
3 loremipsm.txt
```
To see the word count of the file:
```
$ wc -w loremipsm.txt
41 loremipsm.txt
```
Now only the character count of the file:
```
$ wc -m loremipsm.txt
268 loremipsm.txt
```
## **sort**
The _sort_ command is one of the most useful tools. It will sort the data in a file. Sorting is by either characters or numbers in ascending or descending order. It can also be used to sort or randomize the lines of files.
Using _sort_ can be very simple.  All we need to do is provide the name of the file.
```
$ sort filename
```
By default it sorts the data in alphabetical order. One thing to note is that the _sort_ command just displays the sorted data. It does not overwrite the file.
Some useful options for _sort_: 
* -r  To sort the lines in the file in reverse order
* -R To shuffle the lines in the file into random order
* -o To save the output in another file
* -k To sort as per specific column
* -t To mention the field separator
* -n To sort the data according to numerical value
### sort demo
Lets use _sort_ in some short demos:
We have a file, _list.txt_, containing names and numeric values separated by commas.
First lets print out the file and just do simple sorting.
```
$ cat list.txt
Cieran Wilks, 9
Adelina Rowland, 4
Hayden Mcfarlnd, 1
Ananya Lamb, 5
Shyam Head, 2
Lauryn Fuents, 8
Kristian Felix, 10
Ruden Dyer, 3
Greyson Meyers, 6
Luther Cooke, 7
$ sort list.txt
Adelina Rowland, 4
Ananya Lamb, 5
Cieran Wilks, 9
Greyson Meyers, 6
Hayden Mcfarlnd, 1
Kristian Felix, 10
Lauryn Fuents, 8
Luther Cooke, 7
Ruden Dyer, 3
Shyam Head, 2
```
Now sort the data in the reverse order.
```
$ sort -r list.txt
Shyam Head, 2
Ruden Dyer, 3
Luther Cooke, 7
Lauryn Fuents, 8
Kristian Felix, 10
Hayden Mcfarlnd, 1
Greyson Meyers, 6
Cieran Wilks, 9
Ananya Lamb, 5
Adelina Rowland, 4
```
Lets shuffle the data.
```
$ sort -R list.txt
Cieran Wilks, 9
Greyson Meyers, 6
Adelina Rowland, 4
Kristian Felix, 10
Luther Cooke, 7
Ruden Dyer, 3
Lauryn Fuents, 8
Hayden Mcfarlnd, 1
Ananya Lamb, 5
Shyam Head, 2
```
Lets make it more complex. This time we sort the data according to the second field, which is the numeric value, and save the output in another file using the -o option.
```
$ sort -n -k2 -t ',' -o sorted_list.txt list.txt
$ ls
sorted_list.txt list.txt
$ cat sorted_list.txt
Hayden Mcfarlnd, 1
Shyam Head, 2
Ruden Dyer, 3
Adelina Rowland, 4
Ananya Lamb, 5
Greyson Meyers, 6
Luther Cooke, 7
Lauryn Fuents, 8
Cieran Wilks, 9
Kristian Felix, 10
```
Here we used -n to sort in numerical order, -k to specify the field to sort (2 in this case) -t to indicate the delimiter or field-separator (a comma) and -o to save the output in the file _sorted_list.txt_. 
## **sed**
Sed is a stream editor that will filter and transform text in the output. This means we are not making changes in the file, only to the output. We can also save the changes in a new file if needed. Sed comes with a lot of options that are useful in filtering or editing the data. 
The syntax for sed is:
```
$ sed [OPTION] PATTERN filename
```
Some of the options used with sed:
* -n : To suppress the printing 
* p: To print the current pattern 
* d : To delete the pattern 
* q : To quit the sed script
### sed demo
Lets see _sed_ in action. We start with the file _data_ with the fields indicating number, name, age and operating system.
Printing the lines twice if they occur in a specific range of lines.
```
$ cat data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
$ sed '3,7 p' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
```
Here the operation is specified in single quotes indicating lines 3 through 7 and using p to print the pattern found. The default behavior of sed is to print every line after parsing it. This means lines 3 through 7 appear twice because of the p instruction.
So how can you print specific lines from the file? Use the -n option to eliminate lines that do not match from the output.
```
$ sed -n '3,7 p' data
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
```
Only lines 3 through 7 will appear using -n .
Omitting specific lines from the file. This uses the d to delete the lines from the output.
```
$ sed '3 d' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
$ sed '5,9 d' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
```
Searching for a specific keyword in the file.
```
$ sed -n '/linux/ p' data
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
$ sed -n '/linux/I p' data
1 Vicky Grant 20 Linux
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
```
In these examples we have a regular expression which appears in / /. If we have similar words in the file but not with proper case then we use the “I” to make the search case insensitive. Recall that the -n eliminates the lines that do not match from the output.
Replacing the words in the file.
```
$ sed 's/linux/linus/' data
1 Vicky Grant 20 Linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linus
8 Ralph Martin 19 linus
9 Mindy Howard 20 Mac
```
Here s/ / / denotes that it is a regex. The located word and then the new word to replace it appear between the two /.
## **tr**
The _tr_ command will translate or delete characters. It can transform the lowercase letters to uppercase or vice versa, eliminate repeating characters, and delete specific characters.
One thing weird about _tr_ is that it does not take files as input like _wc_, _sort_ and _sed_ do. We use “|” (the pipe symbol) to provide input to the _tr_ command.
```
$ cat filename | tr [OPTION]
```
Some options used with _tr_:
* -d : To delete the characters in first set of output
* -s : To replace the repeated characters with single occurrence
### tr demo
Now lets use the _tr_ command with the file _letter_ to convert all the characters from lowercase to uppercase.
```
$ cat letter
Linux is too easy to learn,
And you should try it too.
$ cat letter | tr 'a-z' 'A-Z'
LINUX IS TOO EASY TO LEARN,
AND YOU SHOULD TRY IT TOO.
```
Here a-z A-Z denotes that we want to convert characters in the range from “a” to “z” from lowercase to uppercase.
Deleting the “o” character  from the file.
```
$ cat letter | tr -d 'o'
Linux is t easy t learn,
And yu shuld try it t.
```
Squeezing the character “o” from the file means that if “o” is repeated in line then it will remove it and print it only once. 
```
$ cat letter | tr -s 'o'
Linux is to easy to learn,
And you should try it to.
```
## **Conclusion**
This was a quick demonstration of the _wc_, _sort_, _sed_ and _tr_ commands. These commands make it easy to manipulate the text files on the terminal in a quick and efficient way. You may use the _man_ command to learn more about these commands.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/
作者:[mahesh1b][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/mahesh1b/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2018/10/commandlinequicktips-816x345.jpg

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

@ -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

@ -0,0 +1,143 @@
[#]: subject: "Access OpenVPN from a client computer"
[#]: via: "https://opensource.com/article/21/7/openvpn-client"
[#]: author: "D. Greg Scott https://opensource.com/users/greg-scott"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Access OpenVPN from a client computer
======
After building your own VPN on Linux, it's time to finally use it.
![Woman programming][1]
OpenVPN creates an encrypted tunnel between two points, preventing a third party from accessing your network traffic. By setting up your virtual private network (VPN) server, you become your own VPN provider. Many popular VPN services already use [OpenVPN][2], so why tie your connection to a specific provider when you can have complete control yourself?
The [first article][3] in this series set up a server for your VPN, the [second article][4] demonstrated how to install and configure the OpenVPN server software, while the [third article][5] explained how to configure your firewall and start the OpenVPN server software. This fourth and final article demonstrates how to use your OpenVPN server from client computers. This is the reason you did all the work in the previous three articles!
### Create client certificates
Remember that the method of authentication for OpenVPN requires both the server and the client to _have_ something (certificates) and to _know_ something (a password). It's time to set that up.
First, create a client certificate and a private key for your client computer. On your OpenVPN server, generate a certificate request. It asks for a passphrase; make sure you remember it:
```
$ cd /etc/openvpn/ca
$ sudo /etc/openvpn/easy-rsa/easyrsa \
gen-req greglaptop
```
In this example, `greglaptop` is the client computer for which this certificate is being created.
There's no need to import the request into the certificate authority (CA) because it's already there. Review it to make sure:
```
$ cd /etc/openvpn/ca
$ /etc/openvpn/easy-rsa/easyrsa \
show-req greglaptop
```
You can sign as the client, too:
```
$ /etc/openvpn/easy-rsa/easyrsa \
sign-req client greglaptop
```
### Install the OpenVPN client software
On Linux, Network Manager may already have an OpenVPN client included. If not, you can install the plugin:
```
`$ sudo dnf install NetworkManager-openvpn`
```
On Windows, you must download and install the OpenVPN client from the OpenVPN download site. Launch the installer and follow the prompts.
### Copy certificates and private keys to the client
Now your client needs the authentication credentials you generated for it. You generated these on the server, so you must transport them over to your client. I tend to use SSH for this. On Linux, that's the `scp` command. On Windows, you can use [WinSCP][6] as administrator to pull the certificates and keys.
Assuming the client is named `greglaptop`, here are the file names and server locations:
```
/etc/openvpn/ca/pki/issued/greglaptop.crt
/etc/openvpn/ca/pki/private/greglaptop.key
/etc/openvpn/ca/pki/issued/ca.crt
```
On Linux, copy these to the `/etc/pki/tls/certs/` directory. On Windows, copy them to the `C:\Program Files\OpenVPN\config` directory.
### Copy and customize the client configuration file
On Linux, you can either copy the `/etc/openvpn/client/OVPNclient2020.ovpn` file on the server to `/etc/NetworkManager/system-connections/`, or you can navigate to Network Manager in System Settings and add a VPN connection. 
For the connection type, select **Certificates**. Point Network Manager to the certificates and keys you copied from the server.
![VPN displayed in Network Manager][7]
(Seth Kenlon, [CC BY-SA 4.0][8])
On Windows, run WinSCP as administrator to copy the client configuration template `/etc/openvpn/client/OVPNclient2020.ovpn` on the server to `C:\Program Files\OpenVPN\config` on the client. Then:
* Rename it to match the certificate above.
* Change the names of the CA certificate, client certificate, and key to match the names copied above from the server.
* Edit the IP information to match your network.
You need super administrative permissions to edit the client config files. The easiest way to get this might be to launch a CMD window as administrator and then launch Notepad from the administrator CMD window to edit the files.
### Connect your client to the server
On Linux, Network manager displays your VPN. Select it to connect.
 
![Add a VPN connection in Network Manager][9]
(Seth Kenlon, [CC BY-SA 4.0][8])
On Windows, start the OpenVPN graphical user interface (GUI). It produces a graphic in the Windows System Tray on the right side of the taskbar, usually in the lower-right corner of your Windows desktop. Right-click the graphic to connect, disconnect, or view the status.
For the first connection, edit the "remote" line of your client config file to use the _inside IP address_ of your OpenVPN server. Connect to the server from inside your office network by right-clicking on the OpenVPN GUI in the Windows System Tray and clicking **Connect**. Debug this connection. This should find and fix problems without any firewall issues getting in the way because both the client and server are on the same side of the firewall.
Next, edit the "remote" line of your client config file to use the _public IP address_ for your OpenVPN server. Bring the Windows client to an outside network and connect. Debug any issues.
### Connect securely
Congratulations! You have an OpenVPN network ready for your other client systems. Repeat the setup steps for the rest of your clients. You might even use Ansible to distribute certs and keys and keep them up to date. 
* * *
_This article is based on D. Greg Scott's [blog][10] and is reused with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/openvpn-client
作者:[D. Greg Scott][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/greg-scott
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming)
[2]: https://openvpn.net/
[3]: https://opensource.com/article/21/7/vpn-openvpn-part-1
[4]: https://opensource.com/article/21/7/vpn-openvpn-part-2
[5]: https://opensource.com/article/21/7/vpn-openvpn-part-3
[6]: https://winscp.net/eng/index.php
[7]: https://opensource.com/sites/default/files/uploads/network-manager-profile.jpg (VPN displayed in Network Manager)
[8]: https://creativecommons.org/licenses/by-sa/4.0/
[9]: https://opensource.com/sites/default/files/uploads/network-manager-connect.jpg (Add a VPN connection in Network Manager)
[10]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/

View File

@ -0,0 +1,146 @@
[#]: subject: "Change your Linux Desktop Wallpaper Every Hour [Heres How]"
[#]: via: "https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Change your Linux Desktop Wallpaper Every Hour [Heres How]
======
This shell script styli.sh helps to change your Linux desktop wallpaper
in every hour automatically and with several options.GNOMEXfceKDE
PlasmaSway
A nice wallpaper to start your day with, your desktop is refreshing. But it is very cumbersome to find wallpaper, then saving and eventually set as wallpaper. All these steps can be done by this script called [styli.sh][1].
### styli.sh Change your Linux Desktop Wallpaper Every Hour
This is a shell script which you can download from GitHub. When runs, it fetches the wallpapers from popular Subreddits from Reddit and set it as your wallpaper.
This script works with all popular desktop environments such as GNOME, KDE Plasma, Xfce and Sway window manager.
It is loaded with features, and you can run the script with via crontab in every and get a fresh wallpaper in a specific interval.
### Download and Install, Run
Open a terminal and clone the GitHub repo. You need to install [feh][2] and git if not installed.
```
git clone https://github.com/thevinter/styli.sh
cd styli.sh
```
To set a random wallpaper, run below as per your desktop environment.
![Change your Linux Desktop Wallpaper Every Hour using styli.sh][3]
```
./styli.sh -g
```
```
./styli.sh -x
```
```
./styli.sh -k
```
```
./styli.sh -y
```
### Change every hour
To change background every hour, run the following command
```
crontab -e
```
And add the following to the opened file. Dont forget to change the script path.
```
@hourly script/path/styli.sh
```
### Change the subreddits
In the source directory, there is a file called subreddits. It is filled up with some standard subreddits. If you want some more, just add the Subreddit names at the end of the file.
### More Config options
The types of wallpapers, size, can also be set. These are some unique configuration option of this script.
> To set a random 1920×1080 background
> ./styli.sh
>
> To specify a desired width or height
> ./styli.sh -w 1080 -h 720
> ./styli.sh -w 2560
> ./styli.sh -h 1440
>
> To set a wallpaper based on a search term
> ./styli.sh -s island
> ./styli.sh -s “sea sunset”
> ./styli.sh -s sea -w 1080
>
> To get a random wallpaper from one of the set subreddits
> NOTE: The width/height/search parameters DONT work with reddit
> ./styli.sh -l reddit
>
> To get a random wallpaper from a custom subreddit
> ./styli.sh -r
> ./styli.sh -r wallpaperdump
>
> To use the builtin feh bg options
> ./styli.sh -b
> ./styli.sh -b bg-scale -r widescreen-wallpaper
>
> To add custom feh flags
> ./styli.sh -c
> ./styli.sh -c no-xinerama -r widescreen-wallpaper
>
> To automatically set the terminal colors
> ./styli.sh -p
>
> To use nitrogen instead of feh
> ./styli.sh -n
>
> To update &gt; 1 screens using nitrogen
> ./styli.sh -n -m
>
> Choose a random background from a directory
> ./styli.sh -d /path/to/dir
### Closing Notes
A unique and handy script, low on memory and can directly fetch images in an interval like an hour. And make your desktop look [fresh and productive][4] all the time. If you do not like the wallpaper, you can simply run the script from the terminal again to cycle through.
[][5]
SEE ALSO:   List of All Default Ubuntu Official Wallpapers [Gallery]
Do you like this script? Or do you know anything like this for wallpaper switcher? Let me know in the comment box below.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/
作者:[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/thevinter/styli.sh
[2]: https://feh.finalrewind.org/
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Change-your-Linux-Desktop-Wallpaper-Every-Hour-using-styli.sh_.jpg
[4]: https://www.debugpoint.com/category/themes
[5]: https://www.debugpoint.com/2019/09/a-list-of-all-default-ubuntu-official-wallpapers-gallery/

View File

@ -0,0 +1,224 @@
[#]: subject: "Use OpenCV on Fedora Linux part 2"
[#]: via: "https://fedoramagazine.org/use-opencv-on-fedora-linux-part-2/"
[#]: author: "Onuralp SEZER https://fedoramagazine.org/author/thunderbirdtr/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use OpenCV on Fedora Linux part 2
======
![][1]
Cover image excerpted from Starry Night by [Vincent van Gogh][2], Public domain, via Wikimedia Commons
Welcome back to the OpenCV series where we explore how to make use of OpenCV on Fedora Linux. [The first article][3] covered the basic functions and use cases of OpenCV. In addition to that you learned about loading images, color mapping, and the difference between BGR and RGB color maps. You also learned how to separate and merge color channels and how to convert to different color spaces. This article will cover basic image manipulation and show you how to perform image transformations including:
* **Accessing individual image pixels**
* **Modifying a range of image pixels**
* **Cropping**
* **Resizing**
* **Flipping**
### Accessing individual pixels
```
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Read image as gray scale.
img = cv2.imread(cv2.samples.findFile("gradient.png"),0)
# Set color map to gray scale for proper rendering.
plt.imshow(img, cmap='gray')
# Print img pixels as 2D Numpy Array
print(img)
# Show image with Matplotlib
plt.show()
```
![][4]
To access a pixel in a numpy matrix, you have to use matrix notation such as matrix[**r**,**c**], where the **r** is the row number and **c** is the column number. Also note that the matrix is 0-indexed. If you want to access the first pixel, you need to specify matrix[0,0]. The following example prints one black pixel from top-left and one white pixel from top-right-corner.
```
# print the first pixel
print(img[0,0])
# print the white pixel to the top right corner
print(img[0,299])
```
### Modifying a range of image pixels
You can modify the values of pixels using the same notation described above.
```
gr_img = img.copy()
# Modify pixel one by one
#gr_img[20,20] = 200
#gr_img[20,21] = 200
#gr_img[20,22] = 200
#gr_img[20,23] = 200
#gr_img[20,24] = 200
# ...
# Modify pixel between 20-80 pixel range
gr_img[20:80,20:80] = 200
plt.imshow(gr_img, cmap='gray')
print(gr_img)
plt.show()
```
![][5]
### Cropping images
Cropping an image is achieved by selecting a specific (pixel) region of the image.
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR)
img_rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB)
fig, (ax1, ax2) = plt.subplots(1,2)
ax1.imshow(img_rgb)
ax1.set_title('Before Crop')
ax2.imshow(img_rgb[200:400, 300:600])
ax2.set_title('After Crop')
plt.show()
```
![][6]
### Resizing images
**Syntax:** _dst = cv.resize( src, dsize[, dst[, fx[, fy[, interpolation]]]] )_
The _resize_ function resizes the _src_ image down to or up to the specified size. The size and type are derived from the values of _src_, _dsize_,_fx_, and _fy_.
The _resize_ function has two required arguments:
* **src:** input image
* **dsize:** output image size
Optional arguments that are often used include:
* **fx:** The scale factor along the horizontal axis. When this is 0, the factor is computed as _dsize.width/src.cols_.
* **fy:** The scale factor along the vertical axis. When this is 0, the factor is computed as _dsize.height/src.rows_.
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"), cv.IMREAD_COLOR)
img_rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB)
plt.figure(figsize=[18, 5])
plt.subplot(1, 3, 1) # row 1, column 3, count 1
cropped_region = img_rgb[200:400, 300:600]
resized_img_5x = cv.resize(cropped_region, None, fx=5, fy=5)
plt.imshow(resized_img_5x)
plt.title("Resize Cropped Image with Scale 5X")
width = 200
height = 300
dimension = (width, height)
resized_img = cv.resize(img_rgb, dsize=dimension, interpolation=cv.INTER_AREA)
plt.subplot(1, 3, 2)
plt.imshow(resized_img)
plt.title("Resize Image with Custom Size")
desired_width = 500
aspect_ratio = desired_width / img_rgb.shape[1]
desired_height = int(resized_img.shape[0] * aspect_ratio)
dim = (desired_width, desired_height)
resized_cropped_region = cv.resize(img_rgb, dsize=dim, interpolation=cv.INTER_AREA)
plt.subplot(1, 3, 3)
plt.imshow(resized_cropped_region)
plt.title("Keep Aspect Ratio - Resize Image")
plt.show()
```
![][7]
### Flipping images
**Syntax:** _dst = cv.flip( src, flipCode )_
* **dst:** output array of the same size and type as _src_.
The _flip_ function flips the array in one of three different ways.
The _flip_ function has two required arguments:
* **src:** the input image
* **flipCode:** a flag to specify how to flip the image
* Use **0** to flip the image on the x-axis.
* Use a positive value (for example, **1**) to flip the image on the y-axis.
* Use a negative value (for example, **-1**) to flip the image on both axes.
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR)
img_rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB)
img_rgb_flipped_horz = cv.flip(img_rgb, 1)
img_rgb_flipped_vert = cv.flip(img_rgb, 0)
img_rgb_flipped_both = cv.flip(img_rgb, -1)
plt.figure(figsize=[18,5])
plt.subplot(141);plt.imshow(img_rgb_flipped_horz);plt.title("Horizontal Flip");
plt.subplot(142);plt.imshow(img_rgb_flipped_vert);plt.title("Vertical Flip");
plt.subplot(143);plt.imshow(img_rgb_flipped_both);plt.title("Both Flipped");
plt.subplot(144);plt.imshow(img_rgb);plt.title("Original");
plt.show()
```
![][8]
### Further information
More details about OpenCV are available in the [documentation][9].
Thank you.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/use-opencv-on-fedora-linux-part-2/
作者:[Onuralp SEZER][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/thunderbirdtr/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/starry-night-2-816x345.jpg
[2]: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg
[3]: https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/
[4]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-8.png
[5]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-9.png
[6]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-11-1024x408.png
[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/resize_img-1024x338.png
[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/flip_image_cv-1024x250.png
[9]: https://docs.opencv.org/4.5.2/index.html

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: " "
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

@ -0,0 +1,87 @@
[#]: subject: "Remove files and folders in the Linux terminal"
[#]: via: "https://opensource.com/article/21/8/remove-files-linux-terminal"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Remove files and folders in the Linux terminal
======
Learn to safely remove files and folders in the Linux terminal.
![Removing files][1]
To remove a file on a computer using a graphical interface, you usually drag a file or a folder to a "trash" or "recycle" bin. Alternately, you might be able to select the file or folder you want to remove, right-click, and select **Delete**.
When removing a file or folder in the terminal, there is no trash bin, at least by default. On a graphical desktop, the Trash is a protected directory so that users don't accidentally trash the Trash, or move it from its default location and lose track of it. The Trash is just a highly managed folder, so you can make your own Trash folder for use in your terminal.
### Setting up a trash bin for the terminal
Create a directory called **Trash** in your home directory:
```
`$ mkdir ~/Trash`
```
### Removing a file
When you want to remove a file or folder, use the **mv** command to move a file or directory to your Trash:
```
`$ mv example.txt ~/Trash`
```
### Deleting a file or folder permanently
When you're ready to remove a file or folder from your system permanently, you can use the **rm** command to erase all of the data in your Trash folder. By directing the **rm** command to an asterisk (`*`), you delete all files and folders inside the **Trash** folder without deleting the **Trash** folder itself. If you accidentally delete the **Trash** folder, however, you can just recreate it because directories are easy and free to create.
```
`$ rm --recursive ~/Trash/*`
```
### Removing an empty directory
Deleting an empty directory has the special command **rmdir**, which only removes an empty directory, protecting you from recursive mistakes.
```
$ mkdir full
$ touch full/file.txt
$ rmdir full
rmdir: failed to remove 'full/': Directory not empty
$ mkdir empty
$ rmdir empty
```
### Better trash
There are [commands for trashing files][2] that aren't included by default in your terminal, but that you can install from a software repository. They make it even easier to trash files, because they manage and use the very same Trash folder you use on your desktop.
```
$ trash ~/example.txt
$ trash --list
example.txt
$ trash --empty
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/remove-files-linux-terminal
作者:[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/ch01s10.svg_.png?itok=p07au80e (Removing files)
[2]: https://www.redhat.com/sysadmin/recover-file-deletion-linux

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,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,386 @@
[#]: subject: (Command line quick tips: wc, sort, sed and tr)
[#]: via: (https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/)
[#]: author: (mahesh1b https://fedoramagazine.org/author/mahesh1b/)
[#]: collector: (lujun9972)
[#]: translator: (perfiffer)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Command line quick tips: wc, sort, sed and tr
======
![][1]
图片由 Ryan Lerch 提供(遵循 CC BY-SA 4.0 协议)
Linux 发行版十分好用,而且它们有一些用户可能不知道的技巧。让我们来看看一些命令行实用工具,当你热衷于终端而不是 GUI 时,它们可能更顺手。
我们都知道在一个系统上使用终端会更高效。当你编辑和排版一个文本文件时,终端会让你确切的感受到,生活如此简单。
本文将向你介绍 wcsorttr和 sed 命令。
## **wc**
wc 是一个实用工具,全称是 "word count"。顾名思义,它可以用来统计任何文件的行数、单词数和字节数。
让我们来看看它是如何工作的:
```
$ wc filename
lines words characters filename
```
输出的是文件的行数,单词数,字符数和文件名。
想获得特定的输出,我们必须使用选项:
* -c 打印字节总数
* -l 打印行数
* -w 打印单词总数
* -m 打印字符总数
### wc 示例
让我们来看看它的运行结果:
让我们从一个文本文件 “lormipsm.txt” 开始。首先,我们通过 cat 查看文件内容,然后使用 wc。
```
$ cat loremipsm.txt
Linux is the best-known and most-used open source operating system.
As an operating system, Linux is software that sits underneath all of the other software on a computer,
receiving requests from those programs and replaying these requests to the computer's hardware.
$ wc loremipsm.txt
3 41 268 loremipsm.txt
```
假设我只想查看文件的字节数:
```
$ wc -c loremipsm.txt
268 loremipsm.txt
```
查看文件的行数:
```
$ wc -l loremipsm.txt
3 loremipsm.txt
```
查看文件的单词数:
```
$ wc -w loremipsm.txt
41 loremipsm.txt
```
现在只查看文件的字符数:
```
$ wc -m loremipsm.txt
268 loremipsm.txt
```
## **sort**
sort 命令是最有用的工具之一。它会对文件的数据进行排序。可以根据字符或数字进行升序或降序排列。它也可以用来对文件中的行进行排序和随机化。
使用 sort 非常简单。我们需要做的仅仅是提供一个文件名。
```
$ sort filename
```
默认的是按照字母顺序对数据进行排序。需要注意的是 sort 命令仅仅是对数据进行排序展示。它并不会改写文件。
使用 sort 命令的一些有用的选项:
* -r 将文件中的行按倒序进行排序
* -R 将文件中的行打乱为随机顺序
* -o 将输出保存到另一个文件中
* -k 按照特定列进行排序
* -t 使用指定的分隔符,而不使用空格
* -n 根据数值对数据进行排序
### sort 示例
让我们看看 sort 的几个简单示例:
我们有一个 list.txt 的文件,包含逗号分隔的名称和数值。
首先让我们打印出文件内容并简单排序。
```
$ cat list.txt
Cieran Wilks, 9
Adelina Rowland, 4
Hayden Mcfarlnd, 1
Ananya Lamb, 5
Shyam Head, 2
Lauryn Fuents, 8
Kristian Felix, 10
Ruden Dyer, 3
Greyson Meyers, 6
Luther Cooke, 7
$ sort list.txt
Adelina Rowland, 4
Ananya Lamb, 5
Cieran Wilks, 9
Greyson Meyers, 6
Hayden Mcfarlnd, 1
Kristian Felix, 10
Lauryn Fuents, 8
Luther Cooke, 7
Ruden Dyer, 3
Shyam Head, 2
```
现在对数据进行倒序排序。
```
$ sort -r list.txt
Shyam Head, 2
Ruden Dyer, 3
Luther Cooke, 7
Lauryn Fuents, 8
Kristian Felix, 10
Hayden Mcfarlnd, 1
Greyson Meyers, 6
Cieran Wilks, 9
Ananya Lamb, 5
Adelina Rowland, 4
```
让我们打乱数据。
```
$ sort -R list.txt
Cieran Wilks, 9
Greyson Meyers, 6
Adelina Rowland, 4
Kristian Felix, 10
Luther Cooke, 7
Ruden Dyer, 3
Lauryn Fuents, 8
Hayden Mcfarlnd, 1
Ananya Lamb, 5
Shyam Head, 2
```
来看一点更复杂的。这次我们根据第二个字段,也就是数值对数据进行排序,并使用 -o 选项将输出保存到另一个文件中。
```
$ sort -n -k2 -t ',' -o sorted_list.txt list.txt
$ ls
sorted_list.txt list.txt
$ cat sorted_list.txt
Hayden Mcfarlnd, 1
Shyam Head, 2
Ruden Dyer, 3
Adelina Rowland, 4
Ananya Lamb, 5
Greyson Meyers, 6
Luther Cooke, 7
Lauryn Fuents, 8
Cieran Wilks, 9
Kristian Felix, 10
```
这里我们使用 -n 选项按数字顺序进行排序,-k 选项用来指定要排序的字段(在本例中为第 2 个字段),-t 选项指定分隔符或字段分隔符(逗号),-o 选项将输出保存到 sorted_list.txt 文件中。
## **sed**
Sed 是一个流编辑器用于过滤和转换输出中的文本。这意味着我们不需要对原文件进行修改只需要对输出进行修改。如果需要我们可以将更改保存到一个新的文件中。Sed 提供了很多有用的选项用于过滤和编辑数据。
sed 的语法格式如下:
```
$ sed [OPTION] PATTERN filename
```
sed 常用的一些选项:
* -n : 取消默认输出
* p : 打印指定的数据 
* d : 删除指定行
* q : 退出 sed 脚本
### sed 示例
我们来看看 sed 是如何运作的。我们从 data 文件开始,其中的字段表示编号,名称,年龄和操作系统。
如果行出现在特定的行范围内,该行将打印 2 次。
```
$ cat data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
$ sed '3,7 p' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
```
这里的操作用单引号括起来,表示第 3 行和第 7 行,并且使用了 p 打印出符合匹配规则的数据。sed 的默认行为是在解析后打印每一行。这意味着由于使用了 p ,第 3 行到第 7 行打印了两次。
如何打印文件中特定的行?使用 -n 选项来消除在输出中不匹配的行。
```
$ sed -n '3,7 p' data
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
```
使用 -n 仅仅只有第 3 行到第 7 行会被打印。
省略文件中的特定行。使用 d 从输出中删除行。
```
$ sed '3 d' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
$ sed '5,9 d' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
```
从文件中搜索特定的关键字。
```
$ sed -n '/linux/ p' data
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
$ sed -n '/linux/I p' data
1 Vicky Grant 20 Linux
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
```
在这些例子中,我们在 / / 中使用了一个正则表达式。如果文件中有类似的单词,但大小写不一致,可以使用 “I” 使得搜索不区分大小写。回想一下,‘-n 删除了输出中不匹配的行。
替换文件中的单词。
```
$ sed 's/linux/linus/' data
1 Vicky Grant 20 Linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linus
8 Ralph Martin 19 linus
9 Mindy Howard 20 Mac
```
这里 s/ / / 表示它是一个正则表达式。在两个 / 之间的就是定位的单词和需要替换的新单词。
## **tr**
tr 命令可以用来转换或删除字符。它可以将小写字母转换为大写字母,也可以将大写字母转换为小写字母,可以消除重复字符,也可以删除特定字符。
tr 的奇怪之处在于,它不同于 wc, sort, sed 那样接受文件作为输入。我们使用 “|” (管道符)为 tr 命令提供输入。
```
$ cat filename | tr [OPTION]
```
tr 命令使用的一些选项:
* -d : 删除给定输入第一个集合中的指定字符,不做转换
* -s : 将重复出现的字符替换为单个
### tr 示例
现在让我们使用 tr 命令将 letter 文件中的所有小写字符转换为大写字符。
```
$ cat letter
Linux is too easy to learn,
And you should try it too.
$ cat letter | tr 'a-z' 'A-Z'
LINUX IS TOO EASY TO LEARN,
AND YOU SHOULD TRY IT TOO.
```
这里的 a-z A-Z 表示我们想要将 “a” 到 “z” 范围内的小写字符转换为大写字符。
删除文件中的 “o” 字符。
```
$ cat letter | tr -d 'o'
Linux is t easy t learn,
And yu shuld try it t.
```
从文件中压缩字符 “o” 意味着如果 “o” 在文件中重复出现,那么它将会被删除并且只打印一次。
```
$ cat letter | tr -s 'o'
Linux is to easy to learn,
And you should try it to.
```
## **结论**
这是使用 wc, sort, sed, tr 命令的快速演示。这些命令可以方便快捷的操作终端上的文本文件。你可以使用 man 命令来了解这些命令的更多信息。
--------------------------------------------------------------------------------
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)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/mahesh1b/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2018/10/commandlinequicktips-816x345.jpg

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: ( )
[#]: publisher: ( )
[#]: url: ( )
如何安装 elementary 优化工具
======
> 这篇快速教程演示了如何安装 elementary / Pantheon 优化工具。
elementary 优化工具elementary Tweaks Tool是专为 [elementary OS][1] 设计的实用工具。它提供了一些用于修改 elementary 设置的选项。虽然 elementary 已经提供了绝大多数选项,但还有一小部分的 Pantheon 桌面优化是不能直接通过普通设置修改的,因此这个工具才得以诞生。这个工具与 GNOME 中的 [GNOME Tweaks][2] 有些相似。
也就是说,安装这个工具其实十分简单,只是 [elementary OS 6 Odin][3] 与早期版本(例如 elementary OS 5 Juno存在一些区别。从 elementary OS 6 Odin 开始,这个工具已经重命名为 Pantheon 优化工具Pantheon Tweaks Tool。下面是安装步骤。
### 安装 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 and below
如果您正在使用 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` 中使用此工具。
![设置中的 Tweaks优化选项][6]
在 Tweaks 窗口,您可以修改一些选项,配置您的 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)
校对:[校对者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

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