This commit is contained in:
Xingyu Wang 2022-09-11 12:44:20 +08:00
commit 2613c1def3
25 changed files with 2137 additions and 1089 deletions

View File

@ -0,0 +1,182 @@
[#]: subject: "The Basic Concepts of Shell Scripting"
[#]: via: "https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/"
[#]: author: "Sathyanarayanan Thangavelu https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/"
[#]: collector: "lkxed"
[#]: translator: "FYJNEVERFOLLOWS"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15012-1.html"
一些 Shell 脚本的基本概念
======
> 如果你希望自动执行常规任务并使你的生活更轻松,那么使用 Shell 脚本是一个很好的选择。本文将向你介绍一些基本概念,这些概念将帮助你编写高效的 Shell 脚本。
![Shell-scripting][1]
Shell 脚本是一种被设计用来运行命令行解释器 UNIX Shell 的计算机程序。Shell 脚本的各类变种被视作脚本语言。Shell 脚本执行的典型操作包括文件操作、程序执行和文本打印。设置环境、运行程序并执行任何必要的清理或日志记录的脚本称为封装。
### 识别 Shell 命令提示符
你可以通过查看终端窗口中的提示符符号来识别 Linux 系统的计算机上的 Shell 命令提示符的用户是普通用户还是超级用户。`#` 符号用于超级用户,`$` 符号用于具有标准权限的用户。
### 基本命令
脚本附带了很多可以在终端窗口上执行的、用以管理您的计算机的命令。每个命令的详细信息可以在该命令附带的使用手册中找到。你可以使用如下命令来查看手册:
```
man <command>
```
一些常用的命令有:
```
date # 显示当前日期和时间
cal # 显示当前月份日历
df # 显示磁盘使用情况
free # 显示内存使用情况
ls # 列出文件和目录
mkdir # 创建目录
```
每个命令都附带了几个可以一起使用的选项。你可以参考使用手册以了解更多的细节。`man date` 的输出如图 1 所示。
![Figure 1: Manual of date command][2]
### 重定向操作符
当你希望捕获文件中的命令输出或重定向到文件时,可以使用重定向操作符。
| 命令 | 描述 |
| :- | :- |
| `ls -l /usr/bin >file` | 默认标准输出到文件 |
| `ls -l /usr/bin 2>file` | 重定向标准错误到文件 |
| `ls -l /usr/bin > ls-output 2>&1` | 重定向标准错误和标准输出到文件 |
| `ls -l /usr/bin &> ls-output` | 重定向标准错误和标准输出到文件 |
| `ls -l /usr/bin 2> /dev/null` | 写入 `/dev/null`,丢弃输出 |
### 大括号扩展
大括号扩展是 UNIX 提供的强大选项之一。它有助于在一行指令中使用最少的命令完成大量操作。例如:
```
$echo Front-{A,B,C}-Back
Front-A-Back, Front-B-Back, Front-C-Back
```
```
$echo {Z..A}
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
```
```
$mkdir {2009..2011}-0{1..9} {2009..2011}-{10..12}
```
这条命令会为 2009 到 2011 年里的每个月建立一个目录。
### 环境变量
环境变量是一个动态命名的值,它可以影响计算机上运行的进程的行为方式。此变量是进程运行环境的一部分。
| 命令 | 描述 |
| :- | :- |
| `printenv` | 打印出所有环境变量的值。 |
| `set` | 设置 Shell 选项 |
| `export` | 导出环境到随后执行的程序 |
| `alias` | 为命令创建别名 |
### 网络命令
网络命令对于排查网络问题和检查连接到客户机的特定端口非常有用。
| 命令 | 描述 |
| :- | :- |
| `ping` | 发送 ICMP网际网路控制讯息协定数据包 |
| `traceroute` | 打印数据包在网络中的路径 |
| `netstat` | 打印网络连接信息、路由表、接口数据 |
| `ftp`/`lftp` | 互联网文件传输程序 |
| `wget` | 非交互式网络下载器 |
| `ssh` | OpenSSH SSH 客户端 (远程登录程序) |
| `scp` | 安全拷贝 |
| `sftp` | 安全文件传输程序 |
### grep 命令
`grep` 命令用于查找系统和日志中的错误。它是 Shell 拥有的强大工具之一。
| 命令 | 描述 |
| :- | :- |
| `grep -h '.zip' file.list` | `.` 表示任意字符 |
| `grep -h '^zip' file.list` | 以 `zip` 开头 |
| `grep -h 'zip$' file.list` | 以 `zip` 结尾 |
| `grep -h '^zip$' file.list` | 只含有 `zip` |
| `grep -h '[^bz]zip' file.list` | 不含 `b``z` |
| `grep -h '^[A-Za-z0-9]' file.list` | 所有文件名有效的文件 |
### 量词
下面是一些量词的例子:
| 命令 | 描述 |
| :- | :- |
| `?` | 匹配出现 0 次或 1 次的元素 |
| `*` | 匹配出现 0 次或多次的元素 |
| `+` | 匹配出现 1 次或多次的元素 |
| `{}` | 匹配出现特定次数的元素 |
### 文本处理
文本处理是当今 IT 世界中的另一项重要任务。程序员和管理员可以使用这些命令来切片、剪切和处理文本。
| 命令 | 描述 |
| :- | :- |
| `cat -A $FILE` | 显示 `$FILE` 文件的所有内容 |
| `sort file1.txt file2.txt file3.txt > final_sorted_list.txt` | 一次性将所有文件排序 |
| `ls - l | sort -nr -k 5` | 按指定的第 5 列进行排序 |
| `sort --key=1,1 --key=2n distor.txt` | 对第 1 列进行排序(默认按字母表顺序),对第 2 列进行数值排序 |
| `sort foo.txt | uniq -c` | 查找重复的行并显示该行重复的次数 |
| `cut -f 3 distro.txt` | 剪切第 3 列 |
| `cut -c 7-10` | 剪切 7 - 10 字符 |
| `cut -d ':' -f 1 /etc/password` | 分隔符 `:` |
| `sort -k 3.7nbr -k 3.1nbr -k 3.4nbr distro.txt` | 按第 3 列第 7 个字符、第 3 列第 1 个字符和第 3 列第 4 个字符排序 |
| `paste file1.txt file2.txt > newfile.txt` | 合并两个文件 |
| `join file1.txt file2.txt` | 按公共字段连接两个文件 |
### 窍门和技巧
在 Linux 中,我们可以通过使用简单的命令或控制选项返回到命令的历史记录。
| 命令 | 描述 |
| :- | :- |
| `clear` | 清空屏幕 |
| `history` | 查看保存命令的历史记录 |
| `script filename` | 捕获文件中的所有命令执行 |
一些历史命令的技巧:
- `CTRL + R` 搜索命令历史
- `!!number`:执行编号为 `number` 的命令
- `!!` :执行上一条命令
- `!?string` : 执行包含 `string` 的上一条命令
- `!string`:执行以 `string` 开始的上一条命令
- `export HISTCONTROL=ignoredups` 忽略重复条目
- `export HISTSIZE=10000`:设置存储的历史行数
随着你对 Linux 命令逐渐熟悉,你将能够编写封装脚本。所有手动任务,如定期备份、清理文件、监控系统使用情况等,都可以使用脚本自动完成。在学习高级概念之前,本文将帮助您开始编写脚本。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/
作者:[Sathyanarayanan Thangavelu][a]
选题:[lkxed][b]
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Shell-scripting.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Manual-of-date-command.jpg

View File

@ -3,53 +3,54 @@
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "Donkey-Hao"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15010-1.html"
macOS 和 Linux 有什么区别?
======
![](https://img.linux.net.cn/data/attachment/album/202209/08/164354illke77oz64k4smf.jpg)
我们经常对比 [Linux 和 Windows][1],那 macOS 和 Linux 有什么区别呢?
Linux 和 Windows 的差异很明显,但 Linux 和 macOS 却很相似。
Linux 和 Windows 的差异很明显,但 Linux 和 macOS 在很多人看起来却很相似。
二者都可以在命令行中运行 Unix 命令,并且与用户在 Windows 中的体验大相径庭。同时,并不是所有 Windows 上的应用和游戏可以在 macOS 和Linux 上运行。
这就是为什么一些人认为苹果公司的 macOS 是基于 Linux 的系统。尽管有相似之处,但 macOS 并不是 Linux。
这就是为什么一些人认为苹果公司的 macOS 是基于 Linux 的系统。**但事实并非如此。** 尽管有相似之处,但 macOS 并不是 Linux。
这两个类 Unix 的操作系统有很多不同之处,我将在这篇文章中指出二者的异同之处。
就让我们来比较一下苹果和橙色企鹅吧。
就让我们来比较一下苹果和~~橙子~~企鹅吧。
### macOS vs. Linux起源
### 起源
macOS 有一段迷人的历史。它是由史蒂夫·乔布斯的计算机公司 NeXT 所开发的,那时候乔布斯不在苹果公司工作。从技术上讲,它是基于 [Mach 内核][2] 和 Unix 派生的 BSD。
macOS 有一段迷人的历史。它的基础是由史蒂夫·乔布斯的 NeXT 计算机公司所开发的,那时候乔布斯不在苹果公司工作。从技术上讲,它是基于 [Mach 内核][2] 和 Unix 派生的 BSD。
那时候,**NeXT** 开发了 [NeXTSTEP][3] 操作系统来驱动它设计的设备和电脑。尽管有一些人注意到了该操作系统,但是它未获得成功。之后,苹果公司以恢复史蒂夫在董事会的席位作为交易的一部分,收购了 NeXT 公司,使得 NeXTSTEP OS 成为 macOS 的基础。
那时候,**NeXT** 开发了 [NeXTSTEP][3] 操作系统来驱动它设计的设备和电脑。虽然它得到了一些关注,但是它并没有大获成功。之后,苹果公司恢复了史蒂夫在董事会的席位,作为交易的一部分,收购了 NeXT 公司,使得 NeXTSTEP 操作系统成为了 macOS 的基础。
这就是为什么 macOS 是 Unix 组件和苹果公司独家技术相结合的操作系统。
这就是为什么 macOS 是结合了 Unix 组件和苹果公司的专有技术的操作系统。
**相反**Linux (内核)是自由并开源的 Unix 的替代品。
**相反**Linux内核是 Unix 的自由并开源的替代品。
Linux 不是一个操作系统,它需要一些组件比如 [桌面环境][4] 才能成为一个操作系统。有许多 [基于 Linux 的操作系统][5],称之为发行版 (distributions)
Linux 不是一个操作系统,它需要一些组件比如 [桌面环境][4] 才能成为一个操作系统。有许多 [基于 Linux 的操作系统][5],称之为发行版。
简单起见,我们将这些操作系统**Linux** 操作系统而不是特定的发行版。
简单起见,我们将这些操作系统**Linux** 操作系统而不是特定的发行版。
### macOS 内核 vs. Linux 内核
macOS 内核的官方名称为 XNU。 [首字母缩略词][6] 代表 “XNU 不是 Unix”。根据 [苹果公司的 Github 页面][7]XNU 是“将卡内基梅隆大学开发的 Mach 内核,与来自 FreeBSD 的组件,和用于编写驱动程序的 C++ API 相结合的一个混合内核”。代码的 BSD 子系统部分是 [“在微内核系统中实现用户空间服务”][8]。Mach 部分负责底层工作,例如多任务处理、受保护内存、虚拟内存管理、内核调试支持和控制台 I/O。
macOS 内核的官方名称为 XNU。该 [缩写][6] 代表 “<ruby>XNU 不是 Unix<rt>XNU is Not Unix</rt></ruby>LCTT 校注:典型的 GNU 式回文缩写)。根据 [苹果公司的 GitHub 页面][7] 所说XNU 是“将卡内基梅隆大学开发的 Mach 内核,与来自 FreeBSD 的组件,和用于编写驱动程序的 C++ API 相结合的一个混合内核”。其代码的 BSD 子系统部分是 [“通常在微内核系统中作为用户空间服务器实现”][8]。Mach 部分负责底层工作,例如多任务处理、受保护内存、虚拟内存管理、内核调试支持和控制台 I/O。
虽然 macOS 内核结合了微内核 ([Mach][9]) 和单片内核 ([BSD][10]) 的特性,但 Linux 只是一个单片内核。 [单片内核][11] 负责管理 CPU、内存、进程间通信、设备驱动程序、文件系统和系统服务器调用。
macOS 内核结合了<ruby>微内核<rt>micro kernel</rt></ruby>[Mach][9])和<ruby>宏内核<rt>monolithic kernel</rt></ruby>[BSD][10])的特性,而 Linux 只是一个宏内核。[宏内核][11] 负责管理 CPU、内存、进程间通信、设备驱动程序、文件系统和系统服务器调用。
### 二者共同之处
macOS 利用 Unix 组件,而 Linux 是作为 Unix 的替代品而构建的。那么,二者有什么共同点?
macOS 利用 Unix 组件,而 Linux 是作为 Unix 的替代品而构建的。那么,二者有什么共同点
二者都可以使用 **Unix 命令、bash/zsh、以及其他 shell**。或许 [默认 shell][12] 会有所不同,但是你可以根据你的喜好进行设置。除此之外,我想不到二者还有什么相似之处。
大概在十年前,我们可以说 Linux/macOS 提供了更少的应用程序。但时过境迁。多年来,二者的软件生态和游戏支持都在不断发展,我们将在本文后面讨论。
大概在十年前,我们可以说 Linux/macOS 提供的应用程序都比较少。但时过境迁。多年来,二者的软件生态和游戏支持都在不断发展,我们将在本文后面讨论。
### 代码库:闭源与开源
@ -57,40 +58,40 @@ macOS 利用 Unix 组件,而 Linux 是作为 Unix 的替代品而构建的。
macOS 是一个闭源的操作系统,意味着你无法看到完整的操作系统源码。
当然,可以获得 [部分 macOS (大多为 GNU库的源码][14]。有用来开发 macOS 和 iOS 操作系统的 [XNU 内核代码][15]。但是 [你不能只用该代码构建 macOS 的克隆版][16],并安装在任何硬件上。
当然,可以获得 [部分 macOS大多为 GNU库的源码][14]。有用来开发 macOS 和 iOS 操作系统的 [XNU 内核代码][15]。但是 [你不能只用这些代码构建出一个 macOS 的克隆版][16],并安装在任何硬件上。
没有源码的世界不会崩塌,但你会因为苹果公司保护和增强你使用电脑体验的声明和实践,而获得 **更少的透明度**
没有源码并不不是世界末日,但你会因为苹果公司保护和增强你使用电脑体验的主张和实践,而获得 **更少的透明度**
一些人认为出于安全的原因而保持闭源。然而,不论开源还是闭源都面临安全威胁。
一些人认为出于安全的原因而应该保持闭源。然而,不论开源还是闭源都面临安全威胁。
**二者的不同** 是:相对于员工数量有限的苹果公司来说,由于有很多开发者在开源社区中,所以会很快修复开源软件
**二者的不同** 是:相对于员工数量有限的苹果公司来说,由于有很多开发者在开源社区中,所以开源软件会很快得到修复。
除非你毫无保留的相信苹果,不然 Linux 的开源模式更胜一筹。
### 目的和用途 macOS vs. Linux
### 目的和用途
macOS 专为台式机和笔记本电脑使用而设计。它非常适合于 **视频编辑、图形设计和音频编辑**
当谈到 Linux ,你可以做很多事情。你可以将 Linux 用于:
* 客户端
* Toaster (希望你了解 [物联网 IoT][17]
* 单
* Toaster希望你了解 [物联网 IoT][17]
* 单
* 服务器
当然,在各种平台上使用它的体验并不相同,但 Linux 可以针对各种用例运行。
所以,如果你喜欢 Linux你可以选择在其他平台上继续使用它,以获得舒适的体验。
所以,如果你喜欢 Linux你可以选择在其他平台上也使用 Linux,以获得舒适的体验。
### macOS vs Linux: 用户体验
### 用户体验
当谈到用户体验,这取决于个人喜好。
macOS 提供了 **令人愉悦的用户界面**微妙的动画和高分辨率的壁纸、图标,这在视觉上很有吸引力。
macOS 提供了 **令人愉悦的用户界面**细致的动画和高分辨率的壁纸、图标,这在视觉上很有吸引力。
![macOS Monterey][18]
你可以期待 macOS Monterey 版的跨平台的无缝体验。
你可以期待在整个平台上获得轻松和无缝的体验。
使用 Linux你可以获得同样令人愉悦且易于使用的用户界面。
@ -100,67 +101,67 @@ macOS 提供了 **令人愉悦的用户界面**。微妙的动画和高分辨率
你可以查看 [最好的桌面环境][20] 列表。你甚至还可以选择 [类似 macOS 的 Linux 发行版][21]。
例如,如果你使用 **Pop!_OS, Ubuntu, Zorin OS, 或者 elementary OS** ,你将获得超棒的体验。
例如,如果你使用 **Pop!_OS、Ubuntu、Zorin OS 或者 elementary OS** ,你将获得超棒的体验。
![Pop!_OS 22.04 LTS][22]
如果你使用类似于 MX Linux 或者其他的发行版,用户体验无法与 macOS 相提并论。
如果你使用类似于 MX Linux 或者其他的发行版,用户体验可能无法与 macOS 相提并论。
![MX Linux][23]
总的来说Linux 的开箱即用体验是不一致的,但如果你知道自己在做什么,它就足够了。
如果你之前使用 Windows刚开始会对 Linux 的界面感到困惑。
如果你之前使用的是 Windows刚开始会对 Linux 的界面感到困惑。
### 可定制性
![customizability][24]
如果你想要一个可以让你对它的各个方面进行修补的操作系统,那 macOS 不适合你。
如果你想要一个可以让你对它的各个方面进行改动的操作系统,那 macOS 不适合你。
尽管大多情况下苹果的设计在美学上会令人愉悦,但并不是每个人都喜欢它们。
如果你想个性化、控制和大量定制操作系统的具体细节Linux 应该是完美的选择。
如果你想要个性化、控制,并大量定制操作系统的具体细节Linux 应该是完美的选择。
你可以根据需要选择自定义用户界面,使用广泛的不同元素,并根据你的喜好尽情发挥。请查看我们的 [KDE 定制][25] 指南以探索可能性。
你可以根据需要选择自定义用户界面,使用各种不同元素,并根据你的喜好尽情发挥。请查看我们的 [KDE 定制][25] 指南以探索可能性。
虽然这很好,但在 Linux 系统上自定义内容时可能会适得其反。因此,你需要学习、探索你想要自定义的内容。
虽然这很好,但在 Linux 系统上自定义内容时可能会适得其反,把它搞乱。因此,你需要学习、探索你想要自定义的内容。
### 运行硬件要求macOS vs Linux
### 运行硬件要求
![hardware illustration][26]
硬件使 macOS 受到“重创”
硬件是 macOS 遭受“重创”的地方
如果你想获得 macOS 并有良好的体验,那需要购买昂贵的苹果硬件
如果你想获得 macOS 并有良好的体验,那需要购买昂贵的苹果硬件
例如,支持 macOS 的笔记本电脑的基本配置从 **8 GB RAM** 和 **256 GB 存储空间**开始,价格为 **$1200** 或更多。
例如,支持 macOS 的笔记本电脑的基本配置从 **8 GB 内存** 和 **256 GB 存储空间** 开始,价格为 **$1200** 或更多。
除非你想经常使用交换空间进行多任务处理,并且已经拥有云存储空间,否则买苹果设备将是一个糟糕的主意。
相比之下如果你不想花很多钱但仍希望为你的系统PC/笔记本电脑)配置一个不错的配置,那么以 800 美元左右的价格购买一台配备 16 GB RAM + 512 GB SSD 的设备来运行 Linux 是很容易的。
相比之下如果你不想花很多钱但仍希望为你的系统PC/笔记本电脑)配置一个不错的配置,那么以 800 美元左右的价格购买一台配备 16 GB 内存 + 512 GB SSD 的设备来运行 Linux 是很容易的。
**个人说明**:我习惯了 32 G 的 RAM + 500 GB 的 SSD 存储。为了获得这种多任务处理空间(不使用交换),我将不得不向苹果公司支付溢价。
**个人说明**:我习惯了 32 G 的内存 + 500 GB 的 SSD 存储。为了获得这种多任务处理空间(不使用交换空间),我将不得不向苹果公司支付溢价。
一些熟练的“修补匠”尝试在非苹果公司的硬件上运行 macOS。这样的系统被称为 [Hackintosh][27],但它肯定远不及在一般计算机上运行 Linux 的舒适度。
一些熟练的“修补匠”尝试在非苹果公司的硬件上运行 macOS。这样的系统被称为 <ruby>[黑苹果][27]<rt>Hackintosh</rt></ruby>,但它肯定远不及在普通计算机上运行 Linux 的舒适度。
### 软件生态
通过苹果公司为 macOS 制作的专应用程序或工具,可以在 macOS 上获得 **一流的原生体验**
通过苹果公司为 macOS 制作的专应用程序或工具,可以在 macOS 上获得 **一流的原生体验**
是的,你可能必须购买这些应用程序。但是,与某些订阅选项不同的是,你可以通过 macOS 一次性购买专业应用程序
是的,你可能必须购买这些应用程序。但是,与某些订阅选项不同的是,你可以通过 macOS 获得一次性购买选项
![Final Cut Pro on macOS][28]
对于想要设计、编辑视频、编辑照片并拥有创意的用户,如果你不介意投资macOS 的软件套件应该是一个不错的选择。
对于想要设计、编辑视频、编辑照片并拥有创意的用户,如果你不介意投资的话macOS 的软件套件应该是一个不错的选择。
免费的苹果工具(如 iMovie、Keynote 等)本身就很好。将它们与 Final Cut Pro、Affinity Designer 等高级工具结合使用,你将获得世界级的编辑体验。别忘了,在 macOS 上也可以使用 Adobe 等创意工具。
此外,苹果公司对其平台可用的应用程序有严格的指导方针,以增强第三方应用程序(免费或付费)的原生体验。
此外,苹果公司对其平台的应用程序有严格的指导方针,以增强第三方应用程序(免费或付费)的原生体验。
这就是为什么许多设计师和编辑更喜欢使用 macOS 而不是任何其他操作系统的原因。
这就是为什么许多设计师和编辑更喜欢使用 macOS 而不是其他操作系统的原因。
对于 Linux 平台,你可以使用 **很棒的 FOSS 替代品** 来替代一些仅限 macOS 的应用程序。除非你喜欢或有使用 macOS 特定应用程序的经验,否则你应该不会在使用适用于 Linux 的软件方面遇到问题。
对于 Linux 平台,你可以使用 **很棒的自由及开源软件** 来替代一些仅限于 macOS 的应用程序。除非你喜欢或有使用 macOS 特定应用程序的经验,否则你应该不会在使用适用于 Linux 的软件方面遇到问题。
![kdenlive editor][29]
@ -168,23 +169,23 @@ macOS 提供了 **令人愉悦的用户界面**。微妙的动画和高分辨率
![Planner (To-do list app for Linux)][30]
它可能不像 macOS 那样完美,但如果你不是专业级的视频、图形编辑,应该没有任何问题。
它可能不像 macOS 那样完美,但如果你不是专业级的视频、图形编辑人员,应该没有任何问题。
### 在 Linux 和 macOS 上游戏
![gaming illustration][31]
苹果公司在使其新的 M1/M2 芯片尽可能强大方面取得了不错的进展,但 macOS 目前对游戏的支持很差。
虽然苹果公司在使其新的 M1/M2 芯片尽可能强大方面取得了不错的进展,但 macOS 目前对游戏的支持很差。
少数游戏可以正常工作,并且大多数都不受官方支持。说实话,为游戏而投资 Mac 并不是它的目的。
少数游戏可以正常工作,并且大多数都不受官方支持。说实话,为游戏而买台 Mac 并不是它的目的。
关于 Linux许多 AAA 游戏和独立游戏运行良好。当然,某些游戏存在一些问题。但是,随着 Valve 推动 Steam Deck 对正版游戏支持,即使是像 **《蜘蛛侠:重制》** 这样的最新版本,都得到了 Steam Deck 的验证
关于 Linux许多 AAA 游戏和独立游戏运行良好。当然,某些游戏存在一些问题。但是,随着 Valve 推动游戏对 Steam Deck 的官方支持,即使是像 **《蜘蛛侠:重制》** 这样的最新版本,都得到了 Steam Deck 的认可
最终,会帮助 Linux 平台对游戏的支持。
最终,会帮助改善 Linux 平台对游戏的支持。
此外,考虑到 PC 显卡市场几乎恢复正常(接近或低于建议零售价),你可以获得不错的 PC 版本或笔记本电脑,而不必担心性能瓶颈。
你会花 **1800 美元以上购买配备 16 GB RAM 和 512 GB SSD 的 Mac**,还是购买配备 32 GB RAM(或更多)和至少 1 TB SSD或更多的 PC/笔记本电脑?
你会花 **1800 美元以上购买配备 16 GB 内存和 512 GB SSD 的 Mac**,还是购买配备 32 GB 内存(或更多)和至少 1 TB SSD或更多的 PC/笔记本电脑?
那由你来决定。
@ -198,39 +199,41 @@ macOS 提供了 **令人愉悦的用户界面**。微妙的动画和高分辨率
你可以获得 [Flatpak][33]、[Snap][34]、[Synaptic][35] 等开箱即用的选项。
但是在默认情况下Mac 用户没有任何可依赖的东西。幸运的是,像 [Homebrew][36] 这样的选项极大的方便了 macOS 用户。
但是在默认情况下Mac 用户没有任何可依赖的软件包管理器。幸运的是,像 [Homebrew][36] 这样的选项极大的方便了 macOS 用户。
它还支持Linux。因此你可以在多个设备上使用它来简化操作。
当然,它还支持 Linux。因此你可以在多个设备上使用它来简化操作。
### 系统升级
![software update illustration][37]
苹果公司不会发布其操作系统具体更新的时间
苹果公司不会发布其操作系统更新的具体计划
例如,**macOS Ventura** (在撰写本文时即将进行版本升级)突然弃了 2017 年之前的所有 Mac 设备。
例如,**macOS Ventura**(在撰写本文时即将进行版本升级)突然弃了 2017 年之前的所有 Mac 设备。
有趣的是,以前的操作系统版本平均支持大约 **七年**,但随着更新的变化,现在似乎大约**五年**。
有趣的是,以前的操作系统版本平均支持 **七年左右**,但随着更新的变化,现在似乎是 **五年左右**。
对于苹果公司设计的芯片,这或许不是一个简单的答案。但是,至少 4 到 5 年的软件支持是安全的。
Linux 为你提供了选择。如果你想要一个没有升级功能只专注于维护和安全性的稳定操作系统Linux 发行版的 [LTS 版本][38] 可以免费为你提供 **五年** 的更新。这主要适用于 [Ubuntu][39] 或基于 Ubuntu 的发行版,如 Linux Mint。
Linux 为你提供了选择。如果你想要一个没有功能升级只专注于维护和安全性的稳定操作系统Linux 发行版的 [LTS 版本][38] 可以免费为你提供 **五年** 的更新。这主要适用于 [Ubuntu][39] 或基于 Ubuntu 的发行版,如 Linux Mint。
此外,有一个 Ubuntu 订阅项目,你可以持续 **十年** 获取安全更新。
此外,有一个 Ubuntu 订阅项目,你可以持续 **十年** 得到安全更新。
而且,它并没有就此结束;你还可以选择 [滚动发行的版本][40],来获得没有结束时间的持续的前沿更新。只要你的硬件能够胜任,你应该就能毫无问题地更新操作系统。
而且,不止于此,你还可以选择 [滚动发行的版本][40],来获得没有结束时间的持续的前沿更新。只要你的硬件能够胜任,你应该就能毫无问题地更新操作系统。
### macOS vs. Linux: 你应该选择哪一个?
如果你需要的话macOS 物有所值。
如果你需要的话macOS 可以说是物有所值。
不建议只需要上网、发送电子邮件,以及执行一些在任何平台上都可以执行的任务的用户购买 macOS。
macOS 仍然是一个不错的选择。
macOS 仍然是一个小众的选择。
然而,随着 Linux 的改进,它已经成为先前是 Windows/macOS 的用户、计算机专业学生、开发人员、创意专业人士(如我们)以及广泛潜在用户的有用的选择。
选择 Linux 而不是 macOS 的原因有很多,但(我认为)不矛盾。你对 macOS 与 Linux 有何看法?欢迎在下面的评论中分享你的想法。
选择 Linux 而不是 macOS (而不是反之)的原因有很多,但这是我的看法。
你对 macOS 与 Linux 有何看法?欢迎在下面的评论中分享你的想法。
--------------------------------------------------------------------------------
@ -239,7 +242,7 @@ via: https://itsfoss.com/mac-linux-difference/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[Donkey-Hao](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -253,7 +256,7 @@ via: https://itsfoss.com/mac-linux-difference/
[6]: https://github.com/apple/darwin-xnu
[7]: https://github.com/apple/darwin-xnu
[8]: http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html
[9]: https://en.wikipedia.org/wiki/Mach_(kernel
[9]: https://en.wikipedia.org/wiki/Mach_(kernel)
[10]: https://en.wikipedia.org/wiki/FreeBSD
[11]: https://www.howtogeek.com/howto/31632/what-is-the-linux-kernel-and-what-does-it-do/
[12]: https://linuxhandbook.com/change-shell-linux/

View File

@ -3,29 +3,32 @@
[#]: author: "Abhishek Prakash https://itsfoss.com/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15009-1.html"
如何在 Linux Mint 中创建和切换工作区
======
![](https://img.linux.net.cn/data/attachment/album/202209/08/103250exm22bu2jtbsyjjj.jpg)
工作区是组织工作的好方法。
假设你打开了太多应用。你的任务栏会很混乱,你可能很难在不同的程序之间查找/移动。
在这种情况下,工作区会派上用场。你可以对不同工作区中的应用进行分组。因此,假设你打开了许多与编程相关的应用。你也在处理文档。
在这种情况下,工作区会派上用场。你可以对不同工作区中的应用进行分组。假设你打开了许多与编程相关的应用,而同时你也在处理文档。
你可以将它们组织在单独的工作区中。单击并拖动应用窗口,它应该显示将应用移动到不同工作区的选项。
这将以更有条理的方式简化你的工作,并节省一些时间和挫败感。
听起来不错?让我向您展示如何在带 [Cinnamon][1] 环境的 Linux Mint 中创建工作区并在它们之间切换。
听起来不错?让我向你展示如何在带 [Cinnamon][1] 桌面环境的 Linux Mint 中创建工作区并在它们之间切换。
### 创建新工作区
在 Linux Mint 中创建或访问工作区很容易。只需按 `CTRL + ALT+ UP`。它将向你显示如下所示的屏幕。
在 Linux Mint 中创建或访问工作区很容易。只需按 `CTRL + ALT+ `。它将向你显示如下所示的屏幕。
只需单击右侧的 + 号即可添加默认 4 以外的新工作区。
只需单击右侧的 `+` 号即可在默认的 4 个工作区之外添加的新工作区。
![Workspace Overview in Linux Mint][2]
@ -35,12 +38,12 @@ Linux Mint 中的工作区是持久的。创建后,这些工作区将始终存
有两种方法可以访问工作区并在它们之间切换。
* 使用 Ctrl+Alt+向上箭头键,将带上所有工作区,然后使用箭头键或鼠标本身在它们之间移动。
* 使用热角hot corner并在左上角移动鼠标。
* 使用 `CTRL + ALT+ ↑`,将显示出所有工作区,然后使用箭头键或鼠标在它们之间移动。
* 使用热角并在左上角移动鼠标。
默认情况下,最新版本的 Linux Mint 中禁用热角功能。
默认情况下,最新版本的 Linux Mint 中禁用热角功能。
要启用热角在工作区之间切换,你应该进入系统设置并选择 **Hot Corners** 选项。
要启用热角在工作区之间切换,你应该进入 <ruby>系统设置<rt>System Settings</rt></ruby> 并选择 <ruby>热角<rt>Hot Corners</rt></ruby> 选项。
![Hot Corners Option in System Settings][3]
@ -50,17 +53,17 @@ Linux Mint 中的工作区是持久的。创建后,这些工作区将始终存
你现在可以通过将鼠标悬停在左上角来访问工作区网格。
此外,如果需要,你可以按右侧的 **+** 符号添加新工作区。或根据需要通过单击名称来重命名现有工作区。
此外,如果需要,你可以按右侧的 `+` 符号添加新工作区。或根据需要通过单击名称来重命名现有工作区。
![Workspace Overview Accessible from Top Left Corner][5]
### 删除工作区
实际上,你可以通过单击 + 号来创建多个工作区。如果你想删除工作区,请单击工作区右上角的 **X** 号,同时将鼠标悬停在该工作区上
实际上,你可以通过单击 `+` 号来创建多个工作区。如果你想删除工作区,请将鼠标悬停在该工作区上,单击工作区右上角的 `X`
![Delete a Workspace][6]
我希望这篇快速文章能帮助你在 Linux Mint 中创建工作区。你经常使用工作空间吗?让我们知道你对工作空间的看法。同时,你还可以查看[安装 Linux Mint 20 后要做的事情][7]的帖子。
我希望这篇快速文章能帮助你在 Linux Mint 中创建工作区。你经常使用工作空间吗?让我们知道你对工作空间的看法。同时,你还可以查看 [安装 Linux Mint 20 后要做的事情][7] 的帖子。
--------------------------------------------------------------------------------
@ -69,7 +72,7 @@ via: https://itsfoss.com/workspaces-linux-mint/
作者:[Abhishek Prakash][a]
选题:[lkxed][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,596 @@
[#]: subject: "21 Basic Linux Networking Commands You Should Know"
[#]: via: "https://itsfoss.com/basic-linux-networking-commands/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15013-1.html"
你应该知道的 22 个基本的 Linux 网络命令
======
![](https://img.linux.net.cn/data/attachment/album/202209/09/151623qbizibbrzfrffrpc.jpg)
我们并不是每天都会谈论 Linux 的命令行。但正如一些读者指出的那样,你们也想学习一些命令行的技巧。
因此,我整理了一份基本的 Linux 网络命令清单,这些命令在我的大学时代帮助了我,让我对如何在网络方面使用 Linux 有了坚定的认识。
这些命令将帮助你设置网络,以及解决你在 Linux 系统中可能遇到的各种网络问题。
### Linux 中的基本网络命令
这个汇编包括了 CLI 实用程序,它们将帮助你排除网络问题、监控数据包和连接的设备,以及更多。
在我展示这些命令的一些细节之前,让我分享一下我今天要讨论的所有命令的简要概述。
| 命令 | 说明 |
| :- | :- |
| `ip` | 操纵路由来分配和配置网络参数 |
| `traceroute` | 识别数据包到达主机的路径 |
| `tracepath` | 在追踪网络主机的路径时,获取最大传输单元 |
| `ping` | 通常用于检查主机和服务器之间的连接情况 |
| `ss` | 获得有关网络套接字的详细信息 |
| `dig` | 给出所有关于 DNS 名称服务器的必要信息 |
| `host` | 输出特定域和主机的 IP 地址 |
| `hostname` | 主要用于输出和更改主机名 |
| `curl` | 在网络上通过各种协议传输数据 |
| `mtr` | `ping``traceroute` 的组合,用于诊断网络 |
| `whois` | 获取有关注册的域名、IP 地址、名称服务器等信息 |
| `ifplugstatus` | 检测本地以太网设备的链接状态 |
| `iftop` | 监视与带宽有关的统计信息 |
| `tcpdump` | 数据包嗅探和分析工具,用于捕获、分析和过滤网络流量 |
| `ethtool` | 允许用户配置以太网设备 |
| `nmcli` | 用于网络连接的故障排除工具 |
| `nmap` | 主要用于审计网络安全 |
| `bmon` | 开源工具,用于监控实时带宽 |
| `firewalld` | 配置防火墙规则的 CLI 工具 |
| `iperf` | 测量网络性能和调整的工具 |
| `speedtest-cli` | speedtest.net 的 CLI 工具,用于检查网速 |
| `vnstat` | 主要用于监控网络流量和带宽消耗 |
现在,让我们用例子和更深入的方式讨论它们。
请注意,并不是所有的命令都会预装。我已经添加了针对 Debian/Ubuntu 的说明。对于其他发行版,请使用你的软件包管理器进行安装。
#### 1、ip 命令
`ip` 命令是最基本的,但也是最重要的,你会发现系统管理员经常使用它,其用于从操纵路由到分配和配置网络参数。
虽然用例可能无穷无尽,但让我向你展示 `ip` 命令的最基本用例(寻找 IP 地址)。
```
ip address
```
![ip address][1]
同样,你也可以使用 `ip` 命令来持续监控设备的状态,请使用 `monitor` 参数而不是我们之前用来获取 IP 地址的 `address` 参数:
```
ip monitor
```
![ip monitor][2]
#### 2、traceroute
使用 `traceroute` 命令,你可以确定数据包到达主机的路线。而且,当你想询问数据包的传输情况和数据包所走的跳数时,它可能相当有用。
默认情况下,你的系统可能没有安装 `traceroute`,如果你使用的是 Debian 及派生的发行版(包括 Ubuntu安装时只需使用一个命令
```
sudo apt install traceroute
```
例如,追踪到 google.com 的数据包:
```
traceroute google.com
```
![traceroute google.com][3]
默认情况下,`traceroute` 会使用 IPv4但是你可以通过使用 `-6` 选项来改变这一行为,该选项将指示 `traceroute` 使用 IPv6。让我告诉你怎么做
![traceroute -6 google.com][4]
#### 3、tracepath
`tracepath` 命令用于发现 MTU最大传输单元同时追踪到网络主机的路径。它与我上面讨论的 `traceroute` 很相似,但它不需要 `sudo` 权限,而且也没有像它那么多功能。
但是,首先什么是 MTU
MTU 就是可以在网络上传输或接收的最大帧或数据包。
现在,让我们看一下 google.com 的 `tracepath` 的基本例子:
```
tracepath google.com
```
![tracepath google.com][5]
同样,你可以使用 `-b` 选项同时打印出 IP 地址和主机名。
```
tracepath -b google.com
```
![tracepath -b google.com][6]
#### 4、ping
[ping 命令][7]<ruby>数据包网络飞龙探云手<rt>Packet Internet Groper</rt></ruby> 🤣) 可以说是在排除网络故障时最重要的命令之一,因为它是检查主机和服务器之间连接情况的最常用方法。
例如,我 `ping` 谷歌:
```
ping google.com
```
![ping google.com][8]
这里,最后一行(`min/avg/max`)表示从指定的服务器获得响应的时间。
如果你得到一个错误提示 `bash: ping: command not found` LCTT 译注:不会吧?),你可以查看我们的指南 [如何在 Ubuntu 上安装 Ping][9]。
#### 5、ss
`ss`<ruby>套接字统计<rt>socket statistics</rt></ruby>)命令用于详细了解网络套接字(在网络上发送和接收数据的端点)。
要列出所有监听和非监听的 TCP 连接,你必须使用 `-at` 选项,如下所示:
```
ss -at
```
![ss -at][10]
同样,你可以使用 `-au` 选项对 UDP 端口进行同样的操作:
```
ss -au
```
![ss -au][11]
#### 6、dig
[dig 命令][12]<ruby>域信息龙爪手<rt>Domain Information Groper</rt></ruby> 😜)用于获取有关域名的所有必要信息。
要在基于 Ubuntu 的发行版上安装 `dig` 工具,请按照给出的命令进行:
```
sudo apt install dnsutils
```
现在,让我告诉你如何获取一个特定主机的信息,在这个例子中,我将获取 itsfoss.com 的信息:
```
dig itsfoss.com
```
![dig itsfoss.com][13]
#### 7、host
`host` 命令主要用于获取一个特定主机的 IP 地址,或者你可以从一个特定的 IP 地址获取主机名。换句话说,它是一个 DNS 查询工具。
要找到主机的 IP你只需要在 `host` 命令中附加主机名。让我告诉你怎么做:
```
host itsfoss.com
```
![host itsfoss.com][14]
同样,你可以用一个 IP 地址来获取主机名:
```
host 8.8.4.4
```
![host 8.8.4.4][15]
#### 8、hostname
如果你已经使用了一段时间的 Linux你一定很熟悉这个命令因为这主要是用来 [改变你的系统的主机名][16] 和 NIS网络信息系统的主机名。
当不使用任何选项时,它可以得到系统当前的主机名。
```
hostname
```
![hostname][17]
从包含所需主机名的文件中改变主机名是这个工具的另一个有趣的功能:
```
sudo hostname -F <filename>
```
![sudo hostname -F][18]
#### 9、curl
`curl`<ruby>客户端 URL<rt>Client URL</rt></ruby>)命令主要用于在网络上传输数据,支持各种协议,包括 HTTP、FTP、IMAP 和许多其他协议。
这个工具是首选的自动化工具,因为它是在没有任何人类互动的情况下工作的,也可以用于端点测试、调试和错误记录。
`curl` 工具没有预装,如果你在任何 Debian 及其派生发行版上,你只需要使用以下命令进行安装:
```
sudo apt install curl
```
使用 `curl` 命令 [下载文件][19] 非常容易,你只需在 URL 中使用 `-O` 选项,就可以开始了。
```
curl -O [URL]
```
![curl -o url][20]
在下载大文件时,进度条会很方便,你可以用 `curl``-#` 选项来显示进度条。
![curl -# -O][21]
#### 10、mtr
它是 `ping``traceroute` 工具的组合,主要用于网络诊断,并提供网络响应和连接的实时情况。
使用 `mtr` 的最简单方法是用它跟上一个主机名或 IP 地址,它将给出一个实时的 `traceroute` 报告。
```
mtr [URL/IP]
```
![mtr google.com][22]
如果你想让 `mtr` 同时显示主机名和 IP 地址,你可以把它和 `-b` 选项配对,如下图:
```
mtr -b [URL]
```
![mtr -b][23]
#### 11、whois
`whois` 可以帮助你找到有关注册的域名、IP 地址、名称服务器等信息,因为它是 whois 目录服务的客户端。
这个工具可能没有预装在你的设备上,要在基于 Debian/Ubuntu 的发行版上安装,你可以使用给出的命令:
```
sudo apt install whois
```
一般来说,`whois` 命令是与给出的域名配对使用的:
```
whois [DomainName]
```
![whois google.com][24]
另外,你也可以用一个 IP 地址来代替域名,你会得到同样的细节。
#### 12、ifplugstatus
`ifplugstatus` 是一个最基本的,但也是最有用的工具,足以在基本水平上排除连接问题。它用于检测本地以太网的链接状态,其工作方式与 `mii-diag`、`mii-tool` 和 `ethtool` 类似,支持所有三个 API。
在基于 Debian/Ubuntu 的发行版上安装,你可以按照给出的命令进行:
```
sudo apt install ifplugd
```
这个工具没有任何花哨的选项,经常不需要与任何配对选项而使用:
```
ifplugstatus
```
![ifplugstatus][25]
#### 13、iftop
`iftop`<ruby>接口的 top<rt>Interface TOP</rt></ruby>)经常被管理员用来监控与带宽有关的统计数据,当你遇到网络问题时,也可以作为诊断工具使用。
这个工具需要手动安装,可以通过给出的命令在运行 Debian/Ubuntu 的机器上轻松安装。
```
sudo apt install iftop
```
`iftop` 在没有任何选项的情况下使用时,它会显示默认接口的带宽统计。
```
sudo iftop
```
![iftop][26]
你也可以通过在设备名称后面加上 `-i` 选项来指定网络设备。
```
sudo iftop -i <DeviceName>.
```
在我的例子中,是 `enp1s0`,所以我的输出将是如下:
![sudo iftop -i enp1s0][27]
#### 14、tcpdump
`tcpdump` 是一个数据包嗅探和分析工具,用于捕获、分析和过滤网络流量。它也可以作为一个安全工具使用,因为它将捕获的数据保存在可以 [通过 Wireshark 访问][28] 的 pcap 文件中。
像许多其他工具一样,`tcpdump` 没有预装如果你是在Debian/Ubuntu 上,你可以按照下面的命令进行安装:
```
sudo apt install tcpdump
```
一旦你完成了安装,你可以获得当前接口的捕获数据包,如下所示:
```
sudo tcpdump
```
![sudo tcpdump][29]
那么如何将捕获的数据包保存在 pcap 文件中呢?让我告诉你怎么做:
```
sudo tcpdump -w Captured_Packets.cap -i < networkdevice >
```
![sudo tcpdump -w][30]
要访问保存的文件,你需要使用 `-r` 选项加上文件名。
```
sudo tcpdump -r Captured_Packets.pcap
```
![sudo tcpdump -r filename][31]
#### 15、ethtool
顾名思义,`ethtool` 工具主要涉及管理以太网设备。使用这个工具,你可以调整网卡速度、自动协商特性等。
但它可能没有预装在你的机器上,可以通过利用给出的命令安装在 Debian/Ubuntu 机器上:
```
sudo apt install ethtool
```
要获取接口的详细信息,你只需在命令后面加上设备名称,如下所示:
```
sudo ethtool <InterfaceName>
```
![sudo ethtool enp1s0][32]
#### 16、nmcli
作为一个简单而强大的网络故障排除工具,它是任何系统管理员在排除网络故障时首先使用的工具之一,也可以在脚本中使用。
你可以使用 `nmcli` 命令来监控设备的连接状态:
```
nmcli dev status
```
![nmcli dev status][33]
当不使用任何选项时,它将带来你系统中所有现有设备的信息:
```
nmcli
```
![nmcli][34]
#### 17、nmap
`nmap` 是一个探索和审计网络安全的工具。它经常被黑客和安全爱好者使用,因为它允许你获得网络的实时信息、连接到你的网络的 IP 的详细信息、端口扫描,以及更多。
要在基于 Debian/Ubuntu 的发行版上安装 `nmap` 工具,请使用给出的命令:
```
sudo apt install nmap
```
让我们开始扫描主机名:
```
nmap itsfoss.com
```
![nmap itsfoss.com][35]
#### 18、bmon
`bmon` 是一个开源的工具,用于监测实时带宽和调试问题,以更人性化的方式呈现统计数据。这个工具最好的部分是图形显示,甚至可以在 HTML 中得到你的输出!
安装非常简单,因为 `bmon` 存在于流行的 Linux 发行版的默认仓库中,这也包括 Debian/Ubuntu。
```
sudo apt install bmon
```
现在,你只需要启动 `bmon`,就可以用眼睛愉快地监控带宽了:
```
bmon
```
![bmon][36]
#### 19、firewalld
管理防火墙可以说是网络安全的核心部分,这个工具允许你添加、配置和删除防火墙的规则。
但是 firewalld 需要手动安装,如果你使用的是基于 Debian/Ubuntu 的发行版,你可以利用给出的命令进行安装:
```
sudo apt install firewalld
```
例如,我将向你展示,如何为公共区域永久地打开 80 端口:
```
sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
```
![sudo firewall-cmd --permanent --zone=public][37]
同样,要删除最近添加的规则,你必须使用 `-remove` 选项,如下所示:
```
sudo firewall-cmd --zone=public --remove-port=80/tcp
```
![sudo firewall-cmd --zone=public --remove][38]
#### 20、iperf
`iperf` 是一个用 C 语言编写的开源工具,允许用户进行网络性能测量和调整。
这个工具存在于 Debian/Ubuntu 的默认资源库中,可以通过给出的命令安装:
```
sudo apt install iperf
```
要开始监控网络,用户必须通过给出的命令在服务器上启动这个客户端:
```
iperf -s -u
```
其中,`-s` 选项表示服务器,`-u` 选项为 UDP 格式。
![iperf -s -u][39]
现在,你可以通过提供首选协议的 IP 地址有效载荷连接到你的服务器(使用 `-c` 选项表示客户端)。在这个例子中,我选择了 UDP使用 `-u` 选项),有效载荷为 100
```
iperf -c 10.0.2.15 -u 100
```
![iperf -c][40]
#### 21、speedtest-cli
顾名思义,这是 speedtest.net 网站的 CLI 工具。这个在 Apache 2.0 许可下发布的开源工具,当你想从 CLI 获得一个可靠的 [检查网速][41] 的来源时,会有很大帮助。
安装非常简单,如果你是在 Debian/Ubuntu 上,可以利用给出的命令轻松安装:
```
sudo apt install speedtest-cli
```
一旦你完成了安装部分,你只需要使用一行命令即可测试你的速度:
```
speedtest-cli
```
![speedtest-cli][42]
#### 22、vnstat
`vnstat` 工具主要被系统管理员用来监控网络流量和带宽消耗(大部分情况下),因为这个工具可以监控你系统的网络接口的流量。
和其他网络工具一样,你可以在默认的软件库中找到 `vnstat`,如果你在 Debian/Ubuntu 上,可以通过给出的命令进行安装:
```
sudo apt install vnstat
```
你可以使用 `vnstat` 命令,不需要任何选项,它将带来你系统所有可用接口的基本统计信息:
```
vnstat
```
![vnstat][43]
对于实时监控,你可以将 `vnstat` 命令与 `-l` 选项配对。
![vnstat -l][44]
### 一个长长的清单,对吗?
这个汇编连冰山一角都算不上,只是分享了每个命令的目的和基本例子,因为增加更多的命令会使这个清单变得更长。
流行的但 [已废弃的 Linux 命令][45],如 `ipconfig`,已被故意排除在这个列表之外。
如果你很好奇,你可以学习 [如何最大限度地利用手册页][46],这将教会你如何使用任何实用程序的最大潜力。
如果我忘了提到任何你喜欢的东西,请在评论中告诉我。
--------------------------------------------------------------------------------
via: https://itsfoss.com/basic-linux-networking-commands/
作者:[Sagar Sharma][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sagar/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/08/ip-address-1.png
[2]: https://itsfoss.com/wp-content/uploads/2022/08/ip-monitor.png
[3]: https://itsfoss.com/wp-content/uploads/2022/08/traceroute-google.com_.png
[4]: https://itsfoss.com/wp-content/uploads/2022/08/traceroute-6-google.com_.png
[5]: https://itsfoss.com/wp-content/uploads/2022/08/tracepath-google.com_.png
[6]: https://itsfoss.com/wp-content/uploads/2022/08/tracepath-b-google.com_.png
[7]: https://linuxhandbook.com/ping-command-ubuntu/
[8]: https://itsfoss.com/wp-content/uploads/2022/08/ping-google.com_.png
[9]: https://linuxhandbook.com/ping-command-ubuntu/
[10]: https://itsfoss.com/wp-content/uploads/2022/08/ss-at.png
[11]: https://itsfoss.com/wp-content/uploads/2022/08/ss-au.png
[12]: https://linuxhandbook.com/dig-command/
[13]: https://itsfoss.com/wp-content/uploads/2022/08/dig-itsfoss.com_.png
[14]: https://itsfoss.com/wp-content/uploads/2022/08/host-itsfoss.com_.png
[15]: https://itsfoss.com/wp-content/uploads/2022/08/host-8.8.4.4.png
[16]: https://itsfoss.com/change-hostname-ubuntu/
[17]: https://itsfoss.com/wp-content/uploads/2022/08/hostname.png
[18]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-hostname-f.png
[19]: https://linuxhandbook.com/curl-command-examples/
[20]: https://itsfoss.com/wp-content/uploads/2022/08/curl-o-url.png
[21]: https://itsfoss.com/wp-content/uploads/2022/08/curl-o.png
[22]: https://itsfoss.com/wp-content/uploads/2022/08/mtr-google.com_.png
[23]: https://itsfoss.com/wp-content/uploads/2022/08/mtr-b.png
[24]: https://itsfoss.com/wp-content/uploads/2022/08/whois-google.com_.png
[25]: https://itsfoss.com/wp-content/uploads/2022/08/ifplugstatus.png
[26]: https://itsfoss.com/wp-content/uploads/2022/08/iftop.png
[27]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-iftop-i-enp1s0.png
[28]: https://itsfoss.com/install-wireshark-ubuntu/
[29]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump.png
[30]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump-w-.png
[31]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump-r-filename.png
[32]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-ethtool-enp1s0.png
[33]: https://itsfoss.com/wp-content/uploads/2022/08/nmcli-dev-status.png
[34]: https://itsfoss.com/wp-content/uploads/2022/08/nmcli.png
[35]: https://itsfoss.com/wp-content/uploads/2022/08/nmap-itsfoss.com_.png
[36]: https://itsfoss.com/wp-content/uploads/2022/08/bmon-800x591.png
[37]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-firewall-cmd-permanent-zonepublic.png
[38]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-firewall-cmd-zonepublic-remove.png
[39]: https://itsfoss.com/wp-content/uploads/2022/08/iperf-s-u.png
[40]: https://itsfoss.com/wp-content/uploads/2022/08/iperf-c-.png
[41]: https://itsfoss.com/network-speed-monitor-linux/
[42]: https://itsfoss.com/wp-content/uploads/2022/08/speedtest-cli.png
[43]: https://itsfoss.com/wp-content/uploads/2022/08/vnstat.png
[44]: https://itsfoss.com/wp-content/uploads/2022/08/vnstat-l.png
[45]: https://itsfoss.com/deprecated-linux-commands/
[46]: https://linuxhandbook.com/man-pages/

View File

@ -3,12 +3,15 @@
[#]: author: "Abhishek Prakash https://itsfoss.com/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15015-1.html"
笔记本电脑合盖时不挂起 Ubuntu
如何在笔记本电脑合盖时不挂起 Ubuntu
======
![](https://img.linux.net.cn/data/attachment/album/202209/09/230733ppyyws84ccgrc777.jpg)
如果你在笔记本电脑上使用 Ubuntu你可能已经注意到当你合上盖子时系统处于挂起状态。
这是预期的行为。它可以节省电池和你的工作。你掀开盖子,系统唤醒,你可以登录并继续工作。
@ -23,21 +26,21 @@
实际上,我注意到最近的 Ubuntu 版本在这个情况下更智能。当笔记本电脑连接到扩展坞并合上盖子时,它不会进入挂起模式。
这是正常的预期行为,但由于 Ubuntu 之神才知的原因,它可能不会一直有效。
这是正常的预期行为,但由于 Ubuntu 某种神才知道的原因,它可能不会一直有效。
好消息是你可以使用 GUI 和命令行强制更改此行为。
让我分享这两种方法。
#### 方法 1使用 GNOME Tweaks
#### 方法 1使用 GNOME 优化
如果你使用的是默认的 GNOME 桌面,那么你很幸运。 [在 Ubuntu 的软件中心安装 GNOME Tweaks 工具][1]或使用以下命令:
如果你使用的是默认的 GNOME 桌面,那么你很幸运。 [在 Ubuntu 的软件中心安装 GNOME 优化Tweaks工具][1]或使用以下命令:
```
sudo apt install gnome-tweaks
```
安装后,启动 Tweaks 应用。在侧边栏的**常规选项卡**中,**关闭“关闭笔记本电脑盖时观其”按钮**
安装后,启动优化应用。在侧边栏的<ruby>常规<rt>General</rt></ruby>选项卡中,关闭“<ruby>笔记本电脑盖合上时挂起<rt>Suspend when laptop lid is closed</rt></ruby>”按钮
![change lid close behavior ubuntu][2]
@ -47,28 +50,29 @@ sudo apt install gnome-tweaks
#### 方法 2更改登录配置针对高级用户
如果你查看文件 /etc/systemd/logind.conf 的内容,你将看到三种不同类型的笔记本电脑合盖默认设置
如果你查看文件 `/etc/systemd/logind.conf` 的内容,你将看到三种不同类型的笔记本电脑合盖默认设置
* HandleLidSwitch当笔记本电脑使用电池供电时
* HandleLidSwitchExternalPower当笔记本电脑插入电源插座时
* HandleLidSwitchDocked当笔记本电脑连接到扩展坞时
* `HandleLidSwitch=suspend`:当笔记本电脑使用电池供电时,合盖挂起
* `HandleLidSwitchExternalPower=suspend`:当笔记本电脑插入电源插座时,合盖挂起
* `HandleLidSwitchDocked=ignore`:当笔记本电脑连接到扩展坞时,合盖忽略
![Default laptop lid closing settings][3]
如你所见,如果合上盖子,笔记本电脑将挂起,无论它是否连接到电源。连接扩展坞忽略合盖。
如你所见,如果合上盖子,笔记本电脑将挂起,无论它是否连接到电源。连接扩展坞忽略合盖。
如果需要,你可以根据自己的喜好将这些参数的值更改为其中之一:
* lock合盖时锁定
* ignore什么都不做
* poweroff关机
* hibernate合盖时休眠
* `suspend`:合盖时挂起
* `lock`:合盖时锁定
* `ignore`:什么都不做
* `poweroff`:关机
* `hibernate`:合盖时休眠
如果你不希望你的系统在笔记本电脑盖合上时执行任何特殊操作,我建议你使用 `ignore`
你可以编辑 /etc/systemd/logind.conf 文件并取消注释上述设置并更改其值,或者在 /etc/systemd/logind.conf.d 目录中创建一个新文件。如果此目录不存在,请创建此目录。
你可以编辑 `/etc/systemd/logind.conf` 文件,或者在 `/etc/systemd/logind.conf.d` 目录中创建一个新文件,并取消注释上述设置并更改其值。如果此目录不存在,请创建此目录。
我不会给你确切的命令。如果你熟悉命令行,你应该可以做到。如果你对命令行感到不舒服,请使用前面的 GUI 方法。
我不会给你确切的命令。如果你熟悉命令行,你应该可以做到。如果你对命令行感到不习惯,请使用前面的 GUI 方法。
我希望这可以帮助你。如果你有任何问题,请告诉我。
@ -79,7 +83,7 @@ via: https://itsfoss.com/laptop-lid-suspend-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lkxed][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,44 @@
[#]: subject: "Image Generation Model Stable Diffusion Is Now Open Source"
[#]: via: "https://www.opensourceforu.com/2022/09/image-generation-model-stable-diffusion-is-now-open-source/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15019-1.html"
图像生成模型 Stable Diffusion 现已开源
======
![](https://www.opensourceforu.com/wp-content/uploads/2022/09/stable-1-768x525.png)
Stable Diffusion 是一个“文本到图像”的人工智能模型。近日Stable AI 公司向公众开放了它的预训练模型权重。当输入一个文字描述时Stable Diffusion 可以生成 512×512 像素的图像,这些图像如相片般真实,反映了文字描述的场景。
这个项目先是经历了早期的代码发布,而后又向研究界有限制地发布了模型权重,现在模型权重已经向公众开放。对于最新版本,任何人都可以在为普通消费者设计的硬件上下载和使用 Stable Diffusion。该模型不仅支持文本到图像的生成而且还支持图像到图像的风格转换和放大。与之一同发布的还有 DreamStudio 测试版,这是一个用于该模型的 API 和 Web 用户界面。
Stable AI 公司表示:
> “Stable Diffusion 是一个文本到图像的模型,它将使数十亿人在几秒钟内创造出令人惊叹的艺术。它在速度和质量上的突破意味着它可以在消费者级的 GPU 上运行。这将允许研究人员和公众在一系列条件下运行它,并使图像生成普及化。我们期待着有围绕这个模型和其他模型的开放生态系统出现,以真正探索潜伏空间的边界。”
Latent Diffusion 模型LDM是 Stable Diffusion 模型建立的一种图像生成方法。LDM 通过在<ruby>潜伏表示空间<rt>latent representation space</rt></ruby>中迭代“去噪”输入来创建图像然后将表示解码为完整的图像这与其他著名的图像合成技术如生成对抗网络GAN和 DALL-E 采用的自动回归方法不同。最近的 IEEE/CVF 计算机视觉和模式识别会议CVPR上有一篇关于 LDM 的论文,它是由慕尼黑路德维希-马克西米利安大学的机器视觉和学习研究小组创建的。今年早些时候InfoQ 也报道的另一个基于扩散的图片生成 AI 是谷歌的 Imagen 模型。
Stable Diffusion 可以支持众多的操作。与 DALL-E 类似,它可以生成一个高质量的图像,并使其完全符合所需图像的文字描述。我们也可以使用一个直观的草图和所需图像的文字描述,从而创建一个看起来很真实的图像。类似的“图像到图像”的能力可以在 Meta AI 的 Make-A-Scene 模型中找到,该模型刚发布不久。
一些人公开分享了 Stable Diffusion 创建的照片的例子Stable AI 的首席开发人员 Katherine Crowson 也在 Twitter 上分享了许多照片。毫无疑问,基于人工智能的图片合成技术将对艺术家和艺术界产生影响,这令一些观察家感到担忧。值得注意的是,在 Stable Diffusion 发布的同一周,一幅由人工智能生成的作品在科罗拉多州博览会的艺术竞赛中获得了最高荣誉。
Stable Diffusion 的源代码可以在 [GitHub][1] 上查阅。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/09/image-generation-model-stable-diffusion-is-now-open-source/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://github.com/CompVis/stable-diffusion

View File

@ -0,0 +1,128 @@
[#]: subject: "Here's What's Coming to Fedora 37"
[#]: via: "https://news.itsfoss.com/fedora-37-features/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15016-1.html"
即将到来的 Fedora 37 前瞻
======
> Fedora 37 将于下个月发布。让我们来看看它带来的变化。
![][1]
最好的 Linux 发行版之一的升级版Fedora 37即将面世。它将在下个月发布如果一切按计划进行它最早将于 2022 年 10 月 18 日发布。而测试版应该在 2022 年 9 月 13 日发布。
让我重点介绍一些你可能想关注的 Fedora 37 重要功能。
### Fedora 37 功能
![Fedora 37][2]
[Fedora][3] 37 带有最新的 GNOME 桌面以及其他完善的功能。这些包括:
#### 1、GNOME 43
![Fedora 37 切换菜单][4]
GNOME 43 和其他一些技术改进将在 Fedora 37 中首次亮相。所以,看看它的体验如何应该是很令人感兴趣的。
这是一次旨在提高用户体验的实质性升级。GNOME 43 中的标志性的重要改进包括一个新的快速切换菜单和 [对 Nautilus 文件管理器的改变][5]。
![Fedora 37 UI][6]
此外,其他一些重要的变化还有:
* GNOME Web 浏览器对 WebExtensions 的支持。
* 文件管理器中新的文档上下文菜单。
* GNOME “软件”的改进。
#### 2、Linux 内核 5.19
![Fedora 37 neofetch][9]
Linux 内核 5.19 是一个有用的更新,它改进了对 ARM SoC 的支持、英特尔的 Arc GPU 支持,以及对 RISC-V 架构支持的一些调整。
你可以查看 [Linux 内核 5.19 的变化列表][10] 来了解更多。
#### 3、桌面环境更新
虽然 GNOME 43 是 Fedora 的旗舰桌面环境,但你也可以找到带有 KDE Plasma 5.26、Xfce 4.16 和 MATE 1.24 的 Fedora 升级版。
在这些版本中,鉴于 KDE Plasma 桌面的一系列改进,带有 KDE Plasma 5.26 的 Fedora 37 也是一个不错的选择。
你可以在我们之前的报道中阅读更多 [关于 KDE Plasma 5.26 版本的信息][11]。
不要忘记,你也可以看到一个 [新的 Budgie 桌面的 Fedora 定制版][13]。
截至目前,桌面、控制中心、屏幕保护程序和桌面视图的软件包都已经出现在 [Fedora 的软件包源][15]。所以,我想你可以期待它们出现在 Fedora 37 的发布中。
#### 4、树莓派 4 支持
Fedora 支持树莓派,但不支持树莓派 4。
在 Fedora 37 中,由于对较新的 Linux 内核和 Mesa图形加速的上游改进它 [正式引入了对树莓派 4 的支持][16]。
这些变化也应该使 Fedora 37 在树莓派 3 系列和 Zero 2 W 上有更好的体验。
#### 5、实验性的基于 Web 界面的安装程序
Fedora 37 将是第一个为其 [Anaconda 安装程序][17] 提供基于网页的用户界面的版本。
换句话说,这是对其当前安装程序的重新设计。请注意,在本次发布之后,它将只作为一个额外的预览镜像提供。
你可以单独下载它并进行实验。到现在为止,我们还不能试用它。所以,你需要在预览镜像可用后再去试试它。
#### 其他变化和新的默认壁纸
![Fedora 37 深色壁纸][18]
对于 Fedora 37除了可以期待很多技术上的改进不要忘了它还有一个新的壁纸有浅色/深色的变体。上图显示了 Fedora 37 的深色壁纸。
浅色变体可以在本文的开头看到。
Fedora 37 的其他变化包括:
![Fedora core os][19]
* Fedora CoreOS 将被确认为 Fedora 的主要版本之一。
* Fedora Cloud 将被列为官方版本之一。
* GNU Emacs 28 更新。
* 用于 Fedora 服务器的新 KVM 镜像。
你可以参考 [官方的 Fedora 37 更新日志][20] 了解更多技术细节。
💬 *你对即将发布的带有 GNOME 43 的 Fedora 37 版本有何看法?请在下面的评论中分享你的想法。*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/fedora-37-features/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/fedora-37-features.png
[2]: https://news.itsfoss.com/content/images/2022/09/fedora-37-screenshot-home.jpg
[3]: https://getfedora.org/
[4]: https://news.itsfoss.com/content/images/2022/09/fedora-37-toggle-menu.jpg
[5]: https://news.itsfoss.com/gnome-files-43/
[6]: https://news.itsfoss.com/content/images/2022/09/fedora-37-ui.jpg
[9]: https://news.itsfoss.com/content/images/2022/09/fedora-37-kernel.png
[10]: https://news.itsfoss.com/linux-kernel-5-19-release/
[11]: https://news.itsfoss.com/kde-plasma-5-26-features/
[13]: https://news.itsfoss.com/fudgie-fedora-budgie-announcement/
[15]: https://src.fedoraproject.org/rpms/budgie-control-center
[16]: https://news.itsfoss.com/fedora-raspberry-pi-4/
[17]: https://fedoraproject.org/wiki/Anaconda
[18]: https://news.itsfoss.com/content/images/2022/09/f37-wallpaper-dark.jpg
[19]: https://news.itsfoss.com/content/images/2022/09/fedora-core-os.jpg
[20]: https://fedoraproject.org/wiki/Releases/37/ChangeSet

View File

@ -1,37 +0,0 @@
[#]: subject: "Image Generation Model Stable Diffusion Is Now Open Source"
[#]: via: "https://www.opensourceforu.com/2022/09/image-generation-model-stable-diffusion-is-now-open-source/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Image Generation Model Stable Diffusion Is Now Open Source
======
The pre-trained model weights for Stable Diffusion, a text-to-image AI model, were made available to the general public by Stability AI. When given a written prompt, Stable Diffusion can produce 512×512 pixel graphics that are photorealistic and represent the scene it describes.
Following the earlier code release and a restricted release of the model weights to the research community, the model weights have now been made available to the general public. With the most recent version, anyone can download and utilise Stable Diffusion on hardware designed for common consumers. The model not only supports text-to-image generation but also image-to-image style transfer and upscaling. Along with the release, Stable AI also made available a beta version of DreamStudio, an API and web UI for the model. Stable AI states that:
“Stable Diffusion is a text-to-image model that will empower billions of people to create stunning art within seconds. It is a breakthrough in speed and quality meaning that it can run on consumer GPUs…This will allow both researchers and…the public to run this under a range of conditions, democratizing image generation. We look forward to the open ecosystem that will emerge around this and further models to truly explore the boundaries of latent space.”
Latent diffusion models are a method of image production that Stable Diffusion is built on (LDMs). LDMs create images by iteratively “de-noising” input in a latent representation space, then decoding the representation into a complete image, in contrast to other well-known image synthesis techniques like generative adversarial networks (GANs) and the auto-regressive approach employed by DALL-E. The recent IEEE / CVF Computer Vision and Pattern Recognition Conference featured a paper on LDM, which was created by the Ludwig Maximilian University of Munichs Machine Vision and Learning research group (CVPR). An further diffusion-based picture generating AI that InfoQ reported earlier this year was Googles Imagen model.
Numerous operations can be supported by the Stable Diffusion model. Similar to DALL-E, it may generate a high-quality image that exactly fits a text description of a desired image. A straightforward sketch and a textual description of the desired image can also be used to create a realistic-looking image. Similar image-to-image abilities may be found in the Make-A-Scene model from Meta AI, which was just just released.
Examples of created photos from Stable Diffusion have been shared openly by several people, and Katherine Crowson, lead developer at Stability AI, has shared numerous photographs on Twitter. The effects that AI-based picture synthesis will have on artists and the art world worry some observers. Stable Diffusion was released the same week that an AI-generated piece of art took home the top honour in the Colorado State Fairs art competition. Stable Diffusions source code is accessible on [GitHub][1].
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/09/image-generation-model-stable-diffusion-is-now-open-source/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://github.com/CompVis/stable-diffusion

View File

@ -0,0 +1,101 @@
[#]: subject: "The New Raspberry Pi OS Update Brings in Sweet Little Improvements"
[#]: via: "https://news.itsfoss.com/raspberry-pi-os-sep-update/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
The New Raspberry Pi OS Update Brings in Sweet Little Improvements
======
Raspberry Pi OS update adds NetworkManager support along with new shortcuts.
![The New Raspberry Pi OS Update Brings in Sweet Little Improvements][1]
If you're an enthusiastic fan of the little computer, you may know that the Raspberry Pi can be used as a fully-fledged desktop computer. Not to forget, it is also at the heart of various electronic/IoT projects.
While many Linux distributions offer images for the Raspberry Pi, the company maintains its official OS for the Pi known as [Raspberry Pi OS][2].
If you didn't know, Raspberry Pi OS is based on Debian. Specifically, [Debian 11 Bullseye][3] for the current version. It is lightweight and uses LXDE as its desktop environment.
### Raspberry Pi OS: What's New?
Although the latest update is not a major one, it still brings in a few helpful additions. If you use your Raspberry Pi as a desktop PC, you will certainly welcome them.
Let's take a look at what the new release offers.
#### Quick Search Functionality for Main Menu
While Windows and many Linux distros already include this basic feature, Raspberry Pi OS did not have it, until now.
Users can hit the Raspberry Pi key or the default host key on the keyboard which will open the main menu and a new search box appears automatically once the user starts typing the name of an app to be launched.
The arrow up and down keys can be used to navigate the menu and the enter key to select the app.
![New search box for main menu][4]
If the user does not type anything, the main menu will function exactly the same as it does when the Raspberry Pi icon is clicked to display the apps.
There's no need to use the mouse cursor to open up the apps anymore.
#### New Keyboard Shortcuts
Just like the main menu, you can also bring up Wi-Fi and Bluetooth toggles by the keyboard.
Performing **Ctrl+Alt+W** will open the Wi-Fi menu while **Ctrl+Alt+B** is reserved for Bluetooth.
#### Enhanced Audio Input Control
The taskbar will now display two separate icons for input and output devices instead of the single default volume icon.
![Volume Slider][5]
A microphone icon will also pop up next to the speaker icon whenever an audio input device gets connected. Moreover, if multiple audio input devices are connected, users can perform a right click on the same icon to select a device from the list while a left click will display the volume control slider.
#### NetworkManager Support
NetworkManager is a popular daemon used by many Linux distros to handle networking functionality. It includes a host of features to help users tweak and configure network settings accordingly.
If you are curious, learn more about daemons in Linux here:
[What are Daemons in Linux? Why are They Used?][6]
For its functionality, initial support for NetworkManager as an alternate option to dhcpcd was introduced. This means that users can easily manage VPN connections without much hassle or even configure the Pi as a Wi-Fi access point.
![][8]
If you still want to try NetworkManager, there are a few advanced steps required to be followed. Users can be assured of the option to switch back to dhcpcd if they face any problems whilst using NetworkManager.
The [official release notes][9] includes a bit more details if you want to explore more about the release.
### Getting Raspberry Pi OS
Head over to the official downloads page linked below to download the new image.
You can use Raspberry Pi Imager on any of your systems to prepare a microSD card to use on a Raspberry Pi. In either case, you can separately download the Raspberry Pi OS file to get it set up.
[Get Raspberry Pi OS][10]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/raspberry-pi-os-sep-update/
作者:[Rishabh Moharir][a]
选题:[lkxed][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/rishabh/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/raspberry-pi-os.jpg
[2]: https://www.raspberrypi.com/software/
[3]: https://news.itsfoss.com/debian-11-feature/
[4]: https://news.itsfoss.com/content/images/2022/09/menu.png
[5]: https://news.itsfoss.com/content/images/2022/09/mic.png
[6]: https://itsfoss.com/linux-daemons/
[8]: https://news.itsfoss.com/content/images/2022/09/nm.png
[9]: https://www.raspberrypi.com/news/the-latest-update-to-raspberry-pi-os/
[10]: https://www.raspberrypi.com/software/

View File

@ -2,7 +2,7 @@
[#]: via: "https://www.debugpoint.com/unix-history/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "Donkey-Hao"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -86,7 +86,7 @@ via: https://www.debugpoint.com/unix-history/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
译者:[Donkey-Hao](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,60 @@
[#]: subject: "Open source matters in data analytics: Here's why"
[#]: via: "https://opensource.com/article/22/9/open-source-data-analytics"
[#]: author: "Ray Paik https://opensource.com/users/rpaik"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Open source matters in data analytics: Here's why
======
Open source is critical in data analysis while providing long-term benefits for the users, community members, and business.
It's been a little over a year since I wrote my article on Opensource.com, [introducing the Cube community][2]. As I worked with our community members and other vendors, I've become more convinced of the benefits of open source in data analytics. I also think it's good to remind ourselves periodically why open source matters and how it provides long-term benefits for everyone.
### Benefits of open source for users and customers
One of the first things I heard from the Cube community was that they often received better support in chat from other community members than they did with proprietary software and a paid support plan. Across many open source communities, I find people who are motivated to help other (especially new) community members and see it as a way of giving back to the community.
You don't need permission to participate in open source communities. A good open source community isn't for developers only, and people feel there's a culture of trust and feel comfortable enough to have open discussions on chat platforms, forums, and issue trackers. This is especially important for non-developers, such as data engineers or analysts in the data analytics space.
Of course, with open source software, there's the ability to see and contribute directly to the codebase to fix bugs or add new features. Using an example from the Cube community, GraphQL support was one of our highlights last year, and our community members [contributed to this feature][3].
There are plenty of benefits to an active community. Even in cases where the vendor cannot release a fix in a timely manner, you can still make the changes yourself and own the runtime while you wait for an "official" fix. Community members and users also don't like being locked in to a vendor's whims, and there's no pressure to upgrade when using open source software.
Open source communities leave many "bread crumbs" in different tools like GitLab, GitHub, Codeberg, YouTube, and so on, making it a lot easier to gauge not just the volume of activities but also the level of community engagement and culture. So even before trying out the software, you can get a good sense of the community's health (and, by extension, the company) before deciding if this is a technology you want to invest in.
### Benefits of open source for the company
There's no better way to lower the barrier to adoption of your software than being open source. Early on, this helps grow adoption among the technical audience. Early adopters then often become some of your most loyal fans for years to come.
Early adopters are also catalysts for speeding up your development. Their feedback on your product and feature requests (for instance on your issue trackers) will provide insight into real-world use cases. In addition, many of the open source enthusiasts participate in co-development efforts (for example, on your repositories) for new features or bug fixes. Needless to say, this is precious for companies in the early days when there is a shortage of resources in development and product teams.
As you tend to your community, you will help it grow and diversify. Increased diversity isn't just in demographics or geography. You want users from new industries, or users with different job titles. Using the Cube community as an example, I mostly talked to application developers a year ago, but now Im meeting with more people that are data consumers or users.
The collaborative culture in good open source communities lowers the barrier to entry not just for developers but also for others who want to ask questions, share their ideas or make other [non-technical contributions][4]. You get better access to diverse perspectives as your company and community grows.
Being open source makes it easy to collaborate with other vendors and communities, not just with individual community members. For example, if you want to work with another vendor on a database driver or integration, it's a lot simpler when you can just collaborate across open source repositories.
### Community matters
All these benefits lead to lowering the barriers to entry for using your software and collaboration. The open source model will not only help individual software or companies, but it can help accelerate the growth of our entire ecosystem and the industry. I hope to see more open source companies and communities in the data analytics space and for all of us to continue this journey.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/9/open-source-data-analytics
作者:[Ray Paik][a]
选题:[lkxed][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/rpaik
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/metrics_data_dashboard_system_computer_analytics.png
[2]: https://opensource.com/article/21/6/cubejs
[3]: https://github.com/cube-js/cube.js/pull/3555
[4]: https://opensource.com/article/22/8/non-code-contribution-powers-open-source

View File

@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/4/load-balancing)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (FYJNEVERFOLLOWS)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
@ -68,7 +68,7 @@ via: https://opensource.com/article/21/4/load-balancing
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,79 +0,0 @@
[#]: subject: "How to Apply Accent Colour in Ubuntu Desktop"
[#]: via: "https://www.debugpoint.com/ubuntu-accent-colour/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "yjacks"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Apply Accent Colour in Ubuntu Desktop
======
Its easy to apply accent colour on Ubuntu desktop, thanks to recent developments. Heres how.
Every Linux distribution has its default theme, bringing a dominant colour. The Accent colours are used to highlight the dominant colour in any setup. Generally, the primary and Accent colours should contrast or complement each other.
With the recent revamp of the GNOME desktop, the Ubuntu desktop introduced Accent colour in the Ubuntu 22.04 LTS release.
Since its pretty obvious how to apply it, but for the sake of new buds in Linux, I will explain how to use Accent colour on an Ubuntu desktop.
### Apply Accent Colour on Ubuntu desktop
1. Open system settings from the application menu.
2. Go to the Appearance tab.
3. Under Style, you should see a set of pre-defined colours.
4. Select one of them to change the Accent colour.
Once changed, the accent colour will be applied to the GTK app selections, GTK controls such as toggle buttons and the default look of the folders.
The default accent colour is Orange, with ten colours available per the following. As of Ubuntu 22.04 LTS, you can not choose the custom accent colour of your choice.
* Orange
* Bark
* Sage
* Olive
* Viridian
* Prussian Green
* Blue
* Purple
* Magenta
* Red
![Accent Colour in Ubuntu][1]
You should remember that the Light and Dark theme with accent colour combination may change your desktops overall appearance.
The above feature is only present in Ubuntu with GNOME and not in vanilla GNOME offerings in other distros such as Fedora Workstation because this is something developed by the Ubuntu team and not merged back to GNOEM upstream.
### Accent Colour in Kubuntu
Using Kubuntu with KDE Plasma desktop, you can also easily use an accent colour. KDE Plasma provides preset colours with custom colour chooser options as well. Also, from KDE Plasma 5.25 onwards, the accent colour can change based on the wallpaper.
To change it in Kubuntu, follow the below steps.
* Open settings from the application menu.
* Go to appearance> Global Theme > Colours Tab.
* And choose your accent colour.
![KDE Plasma 5.25 - Accent Colour Change Based on wallpaper][2]
I know that Lubuntu and Xubuntu do not have this feature yet. And its unlikely to arrive any time soon.
Cheers.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/ubuntu-accent-colour/
作者:[Arindam][a]
选题:[lkxed][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/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/Accent-Colour-in-Ubuntu.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/KDE-Plasma-5.25-Accent-Colour-Change-Based-on-wallpaper-1024x611.jpg
[3]: https://t.me/debugpoint

View File

@ -1,595 +0,0 @@
[#]: subject: "21 Basic Linux Networking Commands You Should Know"
[#]: via: "https://itsfoss.com/basic-linux-networking-commands/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
21 Basic Linux Networking Commands You Should Know
======
Its not every day at Its FOSS that we talk about the “command line side” of Linux. But as some of you readers pointed out in the internal survey (exclusive for Its FOSS newsletter subscribers), you would also like to learn some command line tricks.
So I compiled a list of essential Linux networking commands that helped me during my college days and gave me a firm overview of how you can use Linux on the networking side.
These commands will help you set-up as well as troubleshoot various networking issues you may encounter with your Linux system.
### Essential networking commands in Linux
This compilation includes CLI utilities that will help you with troubleshooting network issues, monitoring packets, connected devices, and much more.
Before I show the commands with some details, let me share a brief overview of all the commands which Im going to discuss today:
| Command | Description |
| :- | :- |
| ip | Manipulating routing to assigning and configuring network parameters |
| traceroute | Identify the route taken by packets to reach the host |
| tracepath | Gets maximum transmission unit while tracing the path to the network host |
| ping | Often used to check the connectivity between the host and the server |
| ss | Gets details about network sockets |
| dig | Gives all the necessary information about the DNS name server |
| host | Prints IP address of a specific domain and viscera |
| hostname | Mostly used to print and change the hostname |
| curl | Transfers data over the network by supporting various protocols |
| mtr | A combination of ping and traceroute is used to diagnose the network |
| whois | Gets info about registered domains, IP addresses, name servers, and more |
| ifplugstatus | Detects the link status of a local Ethernet device |
| iftop | Monitors stats related to bandwidth |
| tcpdump | Packet sniffing and analyzing utility used to capture, analyze and filter network traffic |
| ethtool | Allows users to configure Ethernet devices |
| nmcli | Troubleshooting utility for network connections |
| nmap | Primarily used to audit network security |
| bmon | An open-source utility to monitor real-time bandwidth |
| firewalld | CLI tool to configure rules of Firewall |
| iperf | Utility to measure network performance and tuning |
| speedtest-cli | CLI utility of speedtest.net to check internet speeds |
| vnstat | Mostly used to monitor network traffic and bandwidth consumption |
Now, lets discuss them with examples and more depth.
Please note that not all the commands here will come preinstalled. I have added instructions for Debian/Ubuntu. For other distributions, please use your package manager.
#### 1. IP command
IP (Internet Protocol) is one of the most basic yet essential enough that youd often find it being used by sysadmins, and its use cases can be ranging from manipulating routing to assigning and configuring network parameters.
While the use cases may be endless, let me show you the most basic use case of Ip command (finding an IP address):
```
ip address
```
![ip address][1]
Similarly, you can also use the Ip command to continuously monitor the state of devices by using `monitor` option instead of `address` that we used to get IP addresses previously.
```
ip monitor
```
![ip monitor][2]
#### 2. traceroute
Using the traceroute command, you can identify the route taken by packets to reach the host. And it can be quite useful when you want to interrogate the transmission of data packets and hops taken by packets.
By default, your system may not have traceroute installed and if youre on Debian-derivative (including Ubuntu), installation is single command ahead:
```
sudo apt install traceroute
```
For example, Id be tracerouting packets to google.com
```
traceroute google.com
```
![traceroute google.com][3]
By default, traceroute will utilize IPv4 but you can change this behavior by using `-6` option that will indicate traceroute to use IPv6. Let me show you how:
![traceroute 6 google.com][4]
#### 3. tracepath
The tracepath command is used to discover MTU (Maximum Transmission Unit) while tracing the path to the network host. Its quite similar to what I discussed above but it does require sudo privileges and also has no fact functions like traceroute.
But what is MTU in the first place?
MTU is nothing but the largest frame or packet that can be transmitted or received over the network.
Now, lets have a look at the basic example of tracepath with google.com
```
tracepath google.com
```
![tracepath google.com][5]
Similarly, you can print both IP address and hostname using `-b` option.
```
tracepath -b google.com
```
![tracepath b google.com][6]
#### 4. ping
[The ping (Packet Internet Groper) command][7] can be considered one of the most important commands while troubleshooting your network, as it is the most common way to check the connectivity between the host and the server.
For example, Id be pinging google:
```
ping google.com
```
![ping google.com][8]
Here, the last line (min/avg/max) indicates the time to get a response from the specified server.
And if youre getting an error saying **“bash: ping: command not found”**, you can check out our guide on [how to install Ping on Ubuntu][9].
#### 5. ss
The ss (socket statistics) command is used to detail about network socket (endpoint for sending and receiving data across the network).
To list all the listening and non-listening TCP connection, you have to use `-at` option as shown below:
```
ss -at
```
![ss at][10]
Similarly, you can do the same with UDP ports using `-au` option:
```
ss -au
```
![ss au][11]
#### 6. dig
The [dig (Domain Information Groper) command][12] is used to fetch all the necessary information about the DNS name server.
To install the dig utility on Ubuntu-based distros, follow the given command:
```
sudo apt install dnsutils
```
Now, let me show you how to get info from a specific DNS, and for this example, Id be using itsfoss.com as DNS.
```
dig itsfoss.com
```
![dig itsfoss.com][13]
#### 7. host
The host command is mainly used to get the IP address of a specific domain, or you can get the domain name from a specific IP address. In other words, its just a DNS lookup utility.
To find the IP of the domain, you just have to append the domain name with the host command. Let me show you how:
```
host itsfoss.com
```
![host itsfoss.com][14]
Similarly, you can use an IP address to fetch the domain name:
```
host 8.8.4.4
```
![host 8.8.4.4][15]
#### 8. hostname
You must be familiar with this command if youve been using Linux for a while, as this is mostly used to [change the hostname of your system][16] and NIS (Network Information System) domain name.
When used without any options, it gets the current hostname of the system:
```
hostname
```
![hostname][17]
Changing the hostname from a file containing the desired hostname is yet another interesting feature of this utility.
```
sudo hostname -F <filename>
```
![sudo hostname f][18]
#### 9. curl
The curl (Client URL) command is mostly used to transfer data over the network and supports various protocols including HTTP, FTP, IMAP, and many others.
This tool is preferred in automation as it is built to work without any human interaction and can also be used in endpoint testing, Debugging, and error logging.
The curl utility does not come pre-installed and if youre on any Debian-derivative, you just have to use the following command for installation:
```
sudo apt install curl
```
It is quite easy to download files [using the curl command][19], You just have to use `-O` option with the URL, and youd be good to go!
```
curl -O [URL]
```
![curl o url][20]
While downloading large files, the progress bar can be quite convenient, and you can do the same with curl using `-#` option.
![curl # o][21]
#### 10. mtr
It is a combination of ping and traceroute utilities and is mainly used for network diagnostics and gives live look at network response and connectivity.
The simplest way to use mtr is to append a domain name or IP address with it, and it will give a live traceroute report.
```
mtr [URL/IP]
```
![mtr google.com][22]
And if you want mtr to show both hostnames and IP addresses, you can pair it with `-b` option as shown below:
```
mtr -b [URL]
```
![mtr b][23]
#### 11. whois
The whois can help you find info about registered domains, IP addresses, name servers, and a lot more as it is the client for the whois directory service.
This utility may not be pre-installed on your device and for installation in Ubuntu-based distro, you can use the given command:
```
sudo apt install whois
```
Generally, the whois command is paired with the domain name as given:
```
whois [DomainName]
```
![whois google.com][24]
Alternatively, you can also use an IP address instead of a domain and youd get the same details.
#### 12. ifplugstatus
The ifplugstatus is one of the most basic yet useful enough to troubleshoot connectivity at the basic level. And is used to detect the link status of a local ethernet and works similarly to mii-diag, mii-tool, and ethtool by supporting APIs for all 3.
For installation on Ubuntu-based distros, you can follow the given command:
```
sudo apt install ifplugd
```
This utility does not have any fancy options and often used without being paired with any:
```
ifplugstatus
```
![ifplugstatus][25]
#### 13. iftop
The iftop (Interface TOP) is often used by admins to monitor stats related to bandwidth and can also be used as a diagnostic tool when youre having issues with the network.
This utility requires manual installation and can be easily installed on machines running Ubuntu by the given command:
```
sudo apt install iftop
```
When iftop is used without any options, it shows bandwidth stats of the default interface:
```
sudo iftop
```
![iftop][26]
And you can also specify the network device by appending the device name with `-i` option.
```
sudo iftop -i <DeviceName>
```
In my case its, `enp1s0` so my output will be as follows:
![sudo iftop i enp1s0][27]
#### 14. tcpdump
The tcpdump is a packet sniffing and analyzing utility used to capture, analyze and filter network traffic. It can also be used as a security tool because it saves captured data in pcap file which can be [accessed through Wireshark][28].
Like many other tools, tcpdump does not come pre-installed, and you can follow the given command for installation if youre on Ubuntu base.
```
sudo apt install tcpdump
```
Once youre done with the installation, you can get capture packets for the current interface as given below:
```
sudo tcpdump
```
![sudo tcpdump][29]
So how about saving captured packets in pcap file? Let me show you how:
```
sudo tcpdump -w Captured_Packets.pcap -i <networkdevice>
```
![sudo tcpdump w][30]
To access the saved file, you need to use `-r` option by appending file name:
```
sudo tcpdump -r Captured_Packets.pcap
```
![sudo tcpdump r filename][31]
#### 15. ethtool
As its name suggests, the ethtool utility is primarily concerned with managing ethernet devices. Using this utility allows you to tweak network card speed, auto-negotiation, and much more.
But it may not be pre-installed on your machine and can be installed on a Ubuntu-powered machine by utilizing the given command:
```
sudo apt install ethtool
```
To fetch the interface details, you just have to append the device name with the command as shown below:
```
sudo ethtool <InterfaceName>
```
![sudo ethtool enp1s0][32]
#### 16. nmcli
Being a simple yet powerful network troubleshooting tool, it is one of the first utilities that any sysadmin would use for troubleshooting the network and can also be used in scripts.
You can use nmcli command as given to monitor the connectivity status of devices:
```
nmcli dev status
```
![nmcli dev status][33]
When used without any options, it will bring info about all the present devices in your system.
```
nmcli
```
![nmcli][34]
#### 17. nmap
The nmap is a tool to explore and audit network security. It is often used by hackers and security enthusiasts as it allows you to get real-time info on the network, IPs connected to your network in a detailed manner, port scanning, and much more.
For installation of nmap utility on Ubuntu-based distros, utilize the given command:
```
sudo apt install nmap
```
Lets start scanning with hostname:
```
nmap itsfoss.com
```
![nmap itsfoss.com][35]
#### 18. bmon
The bmon is an open-source utility to monitor real-time bandwidth and debug issues by presenting stats in a more human-friendly way. The best part of this tool is the graphical presentation and can even get your output in HTML!
Installation is quite simple as bmon is present in default repos of popular Linux distros and that also includes Ubuntu.
```
sudo apt install bmon
```
Now, you just have to launch bmon and youd be able to monitor bandwidth in eye pleasant way:
```
bmon
```
![bmon][36]
#### 19. firewalld
Managing firewalls can be considered the core part of network security and this tool allows you to add, configure and remove rules on firewall.
But the firewalld requires manual installation, and you can utilize the given command for installation if youre using an Ubuntu-based distro:
```
sudo apt install firewalld
```
For example, Id show you, how you can open port 80 permanently for the public zone:
```
sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
```
![sudo firewall cmd permanent zone=public][37]
Similarly, to remove the recently added rule, you have to use `-remove` option as shown below:
```
sudo firewall-cmd --zone=public --remove-port=80/tcp
```
![sudo firewall cmd zone=public remove][38]
#### 20. iperf
The iperf is an open-source utility written in C allowing users to perform network performance measurement and tuning.
This tool is present in the default repository of Ubuntu and can be installed from the given command:
```
sudo apt install iperf
```
To start monitoring the network, users must initiate this client on the server by given command:
```
iperf -s -u
```
Where, `-s` option indicates server and `-u` option is for UDP format.
![iperf s u][39]
Now, you can connect to your server (using `-c` option indicating client side) by providing an IP address payload for the preferred protocol. For this example, I went with UDP (using `-u` option) with a payload of 100.
```
iperf -c 10.0.2.15 -u 100
```
![iperf c][40]
#### 21. speedtest-cli
As the name suggests, this is the CLI utility for the speedtest.net website. This open-source utility released under Apache 2.0 license can be quite helpful when you want a reliable source for [checking internet speeds][41] from cli.
Installation is quite straightforward and can easily be installed utilizing the given command if youre on an Ubuntu base:
```
sudo apt install speedtest-cli
```
Once youre done with the installation part, you just have to use a single command to get your speeds tested:
```
speedtest-cli
```
![speedtest cli][42]
#### 22. vnstat
The vnstat utility is mostly used by sysadmins to monitor network traffic and bandwidth consumption (for the most part) as this tool monitors traffic on network interfaces of your system.
As with any other networking tool, you can find vnstat in the default repositories, and if youre on Ubuntu, the installation can be done through the given command:
```
sudo apt install vnstat
```
You can use vnstat command without any options, and it will bring basic stats of all available interfaces of your system:
```
vnstat
```
![vnstat][43]
For live monitoring, you can pair vnstat command with `-l` option:
how to get the most out of man pages
![vnstat l][44]
### A long List, right?
This compilation is not even the tip of the iceberg and only shares the purpose and basic examples of each command because adding more would have made this even longer.
Popular but [deprecated Linux commands][45] like ipconfig have been deliberately left out of this list.
And if youre curious, you can learn [how to get the most out of man pages][46]which will teach you how you can use any utility at its max potential.
And if I forgot to mention any of your favorites, please let me know in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/basic-linux-networking-commands/
作者:[Sagar Sharma][a]
选题:[lkxed][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/sagar/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/08/ip-address-1.png
[2]: https://itsfoss.com/wp-content/uploads/2022/08/ip-monitor.png
[3]: https://itsfoss.com/wp-content/uploads/2022/08/traceroute-google.com_.png
[4]: https://itsfoss.com/wp-content/uploads/2022/08/traceroute-6-google.com_.png
[5]: https://itsfoss.com/wp-content/uploads/2022/08/tracepath-google.com_.png
[6]: https://itsfoss.com/wp-content/uploads/2022/08/tracepath-b-google.com_.png
[7]: https://linuxhandbook.com/ping-command-ubuntu/
[8]: https://itsfoss.com/wp-content/uploads/2022/08/ping-google.com_.png
[9]: https://linuxhandbook.com/ping-command-ubuntu/
[10]: https://itsfoss.com/wp-content/uploads/2022/08/ss-at.png
[11]: https://itsfoss.com/wp-content/uploads/2022/08/ss-au.png
[12]: https://linuxhandbook.com/dig-command/
[13]: https://itsfoss.com/wp-content/uploads/2022/08/dig-itsfoss.com_.png
[14]: https://itsfoss.com/wp-content/uploads/2022/08/host-itsfoss.com_.png
[15]: https://itsfoss.com/wp-content/uploads/2022/08/host-8.8.4.4.png
[16]: https://itsfoss.com/change-hostname-ubuntu/
[17]: https://itsfoss.com/wp-content/uploads/2022/08/hostname.png
[18]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-hostname-f.png
[19]: https://linuxhandbook.com/curl-command-examples/
[20]: https://itsfoss.com/wp-content/uploads/2022/08/curl-o-url.png
[21]: https://itsfoss.com/wp-content/uploads/2022/08/curl-o.png
[22]: https://itsfoss.com/wp-content/uploads/2022/08/mtr-google.com_.png
[23]: https://itsfoss.com/wp-content/uploads/2022/08/mtr-b.png
[24]: https://itsfoss.com/wp-content/uploads/2022/08/whois-google.com_.png
[25]: https://itsfoss.com/wp-content/uploads/2022/08/ifplugstatus.png
[26]: https://itsfoss.com/wp-content/uploads/2022/08/iftop.png
[27]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-iftop-i-enp1s0.png
[28]: https://itsfoss.com/install-wireshark-ubuntu/
[29]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump.png
[30]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump-w-.png
[31]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump-r-filename.png
[32]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-ethtool-enp1s0.png
[33]: https://itsfoss.com/wp-content/uploads/2022/08/nmcli-dev-status.png
[34]: https://itsfoss.com/wp-content/uploads/2022/08/nmcli.png
[35]: https://itsfoss.com/wp-content/uploads/2022/08/nmap-itsfoss.com_.png
[36]: https://itsfoss.com/wp-content/uploads/2022/08/bmon-800x591.png
[37]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-firewall-cmd-permanent-zonepublic.png
[38]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-firewall-cmd-zonepublic-remove.png
[39]: https://itsfoss.com/wp-content/uploads/2022/08/iperf-s-u.png
[40]: https://itsfoss.com/wp-content/uploads/2022/08/iperf-c-.png
[41]: https://itsfoss.com/network-speed-monitor-linux/
[42]: https://itsfoss.com/wp-content/uploads/2022/08/speedtest-cli.png
[43]: https://itsfoss.com/wp-content/uploads/2022/08/vnstat.png
[44]: https://itsfoss.com/wp-content/uploads/2022/08/vnstat-l.png
[45]: https://itsfoss.com/deprecated-linux-commands/
[46]: https://linuxhandbook.com/man-pages/

View File

@ -1,94 +0,0 @@
[#]: subject: "How to Enable Dark Mode in Web Browser"
[#]: via: "https://www.debugpoint.com/dark-mode-browser/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Enable Dark Mode in Web Browser
======
This guide is about helping you on how to enable dark mode in the popular web browser(s) such as Firefox, Google Chrome, Chromium and Microsoft Edge.
We all love dark mode. Many people prefer it over standard light mode. While many desktop applications provide the dark mode natively, some apps adapt to dark mode via the desktop environments underlying modes.
You can not deny that we all spend hours on web browsers. We seldom use desktop apps (unless you are specific to work, such as video editing, etc.). So, when you spend many hours reading and studying in a browser, you can always opt for dark mode. But, coming to the web browser, things are a little different.
This guide gives you the simple steps which you can follow to enable dark mode in Mozilla Firefox, Chromium, Google Chrome and Edge browsers.
### Enable Dark Mode in Web Browser
#### Enable Dark Mode in Firefox
* Open Firefox and click on the little hamburger menu at the right-top.
* Click `Settings > Extension and Themes`.
* Select the `Dark Theme` and click `enable`. And you should see the dark mode is applied to Firefox.
![Enable dark mode in Firefox][1]
![Firefox in Dark Mode][2]
* To revert it back, follow the same steps and select Light Theme.
#### Dark Mode in Chromium and Google Chrome
Chromium or Google Chrome doesnt pre-install any dark theme by default. Hence, you need to go to Chrome Web Store and download any dark theme you want. For this guide I would recommend “Morpheon Dark” theme, which over a million users use.
Open the Morpheon Dark theme page (below link) from the Chromium web browser.
[Morpheon Dark Theme in Chrome Web Store][3]
Click on Add To Chrome button. And it should be enabled in Chrome.
You may want to explore other Black and White or dark themes available in Chrome Web Store. [Visit this page for all collections of dark themes.][4]
However, one thing you should remember is that this theme would not change the settings or context menu. Which is obvious. Because it just changes the browser window, and those menus are part of the operating system itself (sometimes).
![Chromium Dark Theme][5]
Follow the same steps for the Google Chrome browser as well.
#### Edge Browser Dark Mode
[Microsoft Edge browser][6], however, comes with a better dark theme by default. It allows you to use GTK+, Light and Dark mode from settings.
* Open Edge Browser
* Click on the three little dots on the right-top side.
* Go to Appearance and choose Dark. And you should be all set.
This dark theme implementation of Edge is better because it changes the context menu and the address bar.
![Edge in Dark Theme][7]
### Closing Notes
If you are an advanced user, you probably do not need this guide. You can figure it out.
But we cover all the basic to advanced tutorials for all our readers. Many new Linux users may not know how to enable dark mode in the browser as well.
So, that said, I hope this helps you and others. Let me know in the comment box below if you face any trouble.
[Next: Create Bootable USB Using Etcher in Linux Download and Usage Guide][8]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/dark-mode-browser/
作者:[Arindam][a]
选题:[lkxed][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/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2021/10/Enable-dark-mode-in-Firefox.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/Firefox-in-Dark-Mode-1024x423.jpg
[3]: https://chrome.google.com/webstore/detail/morpheon-dark/mafbdhjdkjnoafhfelkjpchpaepjknad?hl=en-GB
[4]: https://chrome.google.com/webstore/category/collection/dark_themes
[5]: https://www.debugpoint.com/wp-content/uploads/2021/10/Chromium-Dark-Theme-1024x463.jpg
[6]: https://www.debugpoint.com/2020/10/how-to-install-edge-ubuntu-linux/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/10/Edge-in-Dark-Theme-1024x541.jpg
[8]: https://www.debugpoint.com/etcher-bootable-usb-linux/

View File

@ -2,7 +2,7 @@
[#]: via: "https://fedoramagazine.org/manage-containers-on-fedora-linux-with-podman-desktop/"
[#]: author: "Mehdi Haghgoo https://fedoramagazine.org/author/powergame/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -0,0 +1,146 @@
[#]: subject: "Connect to Ubuntu 20.04 from Windows 10 [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/connect-ubuntu-20-04-windows-10/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Connect to Ubuntu 20.04 from Windows 10 [Beginners Guide]
======
This beginners guide helps you remotely connect to Ubuntu 20.04 from Windows 10. We show you the easy steps with an example.
If you work in a networked environment at your work or set up a small network at home (wired or wireless), you are often required to remote connect to your Ubuntu machine (or any Linux machine).
Although I have created this guide in Ubuntu 20.04 and Windows 10, the following steps ideally should work for any Linux distribution which supports Xrdp for remote connection.
Technically, there are many ways of connecting to any system over the network (internet or intranet). You can use a client such as Remmina (which is an excellent client) to connect via VNC, and RDP protocol. You can even connect via ssh with X forwarding as well.
In this basic guide, I have used the [Xrdp][1], a free and open-source utility server for Microsoft RDP protocol available in Windows.
### Connect to Ubuntu 20.04 from Windows 10 via remote desktop
#### Step 1: Install xrdp in Ubuntu
The following steps do not require any installation or configuration in Windows 10. Although, you must have enough privilege to run the Microsoft RDP client (mstsc).
In Ubuntu 20.04 (or any Ubuntu version or other similar distributions), install the Xrdp via terminal using the below commands.
```
sudo apt install xrdp
```
If you are using Fedora use the command below.
```
sudo dnf install xrdp
```
And for Arch, use
```
pacman -S xrdp
```
This should install the xrdp server in your Linux system.
#### Step 2: Enable xrdp service
The next step is to enable the `xrdp` service. The service needs to be always running to listen to incoming remote desktop requests. So to do that, run the below command in Ubuntu (and other systemd-based Linux distributions).
```
systemctl enable xrdp
```
This [systemctl][2] command enables your system to start the service immediately and ensure that it runs automatically the next time you boot.
![enable xrdp][3]
You might want to check whether the service is running via the below command:
```
systemctl status xrdp
```
Also, open the Ubuntu settings and`Enable Sharing` and `Enable Screen Sharing`. Follow the below screenshots.
![Enable sharing in settings][4]
![Enable sharing in settings][5]
#### Step 3: Connect to Ubuntu
Open the Windows 10 Start menu and type Remote to bring up the remote connection dialog. You can also press CTRL+R and run mstsc.
![Start Remote connection from Windows][6]
On the above window, **give the IP address of the target Ubuntu 20.04 system**. You can get the IP address from the `Settings -> Wifi or Network` Section. Alternatively, you can run `ifconfig` or `ip a` to get the IPV4 address of the system.
```
ifconfig
```
Or
```
ip a
```
Finally, click connect. You should see the below Xrdp prompt.
![xrdp prompt][7]
Choose the session as xrdp or xvnc. Give the username and password of the Ubuntu 20.04 system and press OK.
You should be connected to the Ubuntu 20.04 system.
![Ubuntu 20.04 Connected from Windows 10][8]
### Usage notes and troubleshooting
* Slow rdp session
The response of the remote session is dependent on your network speed. So you might feel a little bit of slowness on actions (click, scroll, etc) on the desktop.
* Blank screen on rdp session
Ensure the user is logged off from the target Ubuntu 20.04 session which you use for remote connect. If the user logged on and you are connecting you might see a blank screen in Windows 10 rdp session. This has happened on my test, and I am yet to find out why.
* No customization in rdp session
Ideally, when you log on, a default Xorg profile will be created for the same user. That means you might not see any customizations done by the user. A basic GNOME Shell with all options will be available.
* Repeated Authentication Required popup
![Authentication Prompt][9]
There is a chance that you may see multiple popups (like above) asking for a username and password. The main reason is the implementation of Polkit (a component for controlling system-wide privileges) within Ubuntu. When you log in, Polkit rules check whether the user has certain privileges to perform actions (active or passive). The Polkit rules are more restrictive when connecting via RDP. Hence the popup for Authentication. Fixing this requires a complex Polkit rule setup for the remote RDP users. I am still testing this and am not quite able to fix it. The resolution to this problem will be in an upcoming article.
I hope this guide helps you to set up basic RDP from Windows 10 to Ubuntu 20.04. This guide does not require any additional software installation in Windows 10.
[Next: Connect to WiFi Using Terminal in Arch Linux and Other Distros][10]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/connect-ubuntu-20-04-windows-10/
作者:[Arindam][a]
选题:[lkxed][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/lkxed
[1]: http://xrdp.org/
[2]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[3]: https://www.debugpoint.com/wp-content/uploads/2020/12/enable-xrdp.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2020/12/Enable-sharing-in-settings.png
[5]: https://www.debugpoint.com/wp-content/uploads/2020/12/enable-sharing-in-settings-2.png
[6]: https://www.debugpoint.com/wp-content/uploads/2020/12/Start-Remote-connection-from-Windows2.png
[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/xrdp-prompt.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/Ubuntu-20.04-Connected-from-Windows-10-1.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/Authentication-Prompt.jpg
[10]: https://www.debugpoint.com/connect-wifi-terminal-linux/

View File

@ -0,0 +1,160 @@
[#]: subject: "How to use modern Python packaging and setuptools plugins together"
[#]: via: "https://opensource.com/article/22/9/modern-python-packaging-setuptools-plugins"
[#]: author: "Moshe Zadka https://opensource.com/users/moshez"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to use modern Python packaging and setuptools plugins together
======
Using the setuptools plugin with modern Python packaging allows for experimentation with automation.
![How to write a web service using Python Flask][1]
Image by: Yuko Honda on Flickr. CC BY-SA 2.0
Python packaging has evolved a lot. The latest ("beta") uses one file, `pyproject.toml`, to control the package.
A minimal `pyproject.toml` might look like this:
```
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "cool_project"
version = "1.0.0"
```
### The project section
The **project** section is the data about the Python project itself, including fields like **name** and **version**, which are required.
Other fields are often used, including:
* description: A one-line description.
* readme: Location of a README file.
* authors: Author names and e-mails.
* dependencies: Other packages used by this project.
### The build-system section
Though it does not have to be first, the **build-system** usually goes at the top. This is because it is the most important one.
The **build-backend** key points to a module that knows how to build source distributions and wheels from the project. The **requires** field allows specifying *build time* dependencies.
Many projects are built with **setuptools**. There are some new alternatives, like **flit** and **hatch**.
### Plugins
One benefit of the **requires** section in **build-system** is that it can be used to install *plugins*. The **setuptools** package, in particular, can use plugins to modify its behavior.
One thing that plugins can do is to set the version automatically. This is a popular need because version management can often be painful.
### Segue
Before continuing, it is worth reflecting on the nature of "parodies". A *parody of X* is an *instance of X* which exaggerates some aspects, often to the point of humor.
For example, a "parody of a spy movie" *is* a spy movie, even as it riffs on the genre.
### A parody of setuptools plugins
With this in mind, what would a parody of a **setuptools** plugin look like? By the rule above, it has to be a plugin.
The plugin, called **onedotoh**, sets the version to... 1.0.0. In order to be a plugin, it first has to be a package.
A package should have a `pyproject.toml` :
```
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "onedotoh"
version = "1.0.0"
[project.entry-points."setuptools.finalize_distribution_options"]
setuptools_scm = "onedotoh:guess_version"
```
There is a new section: **project.entry-points**. This means that the function **guess_version** will be called as **setuptools** is ready to finalize the distribution options.
The code of **guess_version** is one line:
```
def guess_version(dist):
    dist.metadata.version = "1.0.0"
```
### Version to 1.0.0
Using **onedotoh** is subtle. One problem is writing the **pyproject.toml** **project** section to look like this:
```
[project]
name = "a_pyproject"
version = "0.1.2"
```
The **version** in the **pyproject.toml** will *override* the version from the plugin.
The obvious solution is to remove the **version** field:
```
[project]
name = "a_pyproject"
```
This fails in a different way. Without the **version** in the **project** section, the file is invalid. The **name** will not be used.
The right way to do it is as follows:
```
[project]
name = "a_pyproject"
dynamic = ["version"]
```
This approach explicitly declares the **version** field as dynamic.
A full example will look like this:
```
[build-system]
requires = [
    "setuptools",
    "onedotoh",
]
build-backend = "setuptools.build_meta"
[project]
name = "a_pyproject"
dynamic = ["version"]
```
Finally, the version is automatically set to **1.0.0**.
### Wrap up
The **setuptools** plugin can still be used with modern Python packaging, as long as relevant features are explicitly declared as "dynamic." This makes a field rife for further experimentation with automation.
For example, what if, in addition to guessing the *version* from external metadata, it would guess the name as well, using the **git remote** URL?
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/9/modern-python-packaging-setuptools-plugins
作者:[Moshe Zadka][a]
选题:[lkxed][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/moshez
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/coffee_python.jpg

View File

@ -0,0 +1,123 @@
[#]: subject: "Komikku: A Free and Open-Source Manga Reader for Linux"
[#]: via: "https://itsfoss.com/komikku-manga-reader/"
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Komikku: A Free and Open-Source Manga Reader for Linux
======
Love reading comic books? There are [plenty of comic book readers available for Linux][1].
But what about something tailored for Japanese comic books (Manga)?
I think I came across the perfect app suitable for reading Manga, organizing them, and downloading them for offline use as well. The app I discovered recently is called **Kommiku**.
Let me mention the key highlights of this app and help you get started with it on Linux.
### Komikku: A Linux-only Manga Reader
![Komikku UI][2]
Komikku is an open-source manga reader available as a Linux-only application.
Primarily, it is tailored to go well with the GNOME desktop environment, but you can use it on Linux distributions running [other desktop environments][3].
Many PDF or [E-book readers][4] like Bookworm, Calibre, and Foliate support the Comic book format.
However, Komikku users get more features to have a good experience for reading manga.
![Komikku online servers list][5]
For instance, Komikku can be used to view Manga online and offline. Furthermore, you can download it from supported servers.
### Features of Komikku
![komikku reader][6]
Some of the best functionalities of Komikku include:
* Online reading from dozens of supported servers.
* Offline reading of downloaded comics.
* Categories to organize your library.
* RTL, LTR, Vertical and Webtoon reading modes.
* Several types of navigation (Keyboard arrow keys, right and left navigation layout via mouse click or tapping (touchpad/touch screen), scroll wheel, and swipe gestures (touchpad and touchscreen).
* Automatic update of comics.
* Automatic download of new chapters.
* Reading history.
* Light and dark themes.
* Adaptive design (able to scale from desktop workstations to mobile phones).
* Keyboard shortcuts.
![Komikku compact view][7]
### Installation
Komikku is available on [Flathub][8]. So, you can get it installed on any Linux distribution.
However, you need to [set up Flatpak and enable Flathub repo on your system][9].
Once you have Flatpak set up on your system, you can search for it through the software center or install it from your terminal.
![Installing Komikku from GNOME Software][10]
To install Komikku using the terminal, type the following command
```
flatpak install flathub info.febvre.Komikku
```
Native packages for Komikku are also available for distributions like Arch Linux and Fedora. Here are the commands to get them installed:
For Arch Linux (available in AUR):
```
yay -Syu komikku
```
For Fedora (available in official repos):
```
sudo dnf install komikku
```
Check out Komikkus source code and the instructions to build it from the source on its [GitLab page][11]. Head to its official webpage to know more about it.
[Download Komikku][12]
### Conclusion
I found Komikku to be very intuitive and clean. Noted that the online servers do not always work, one can expect some hiccups, but managing offline comics and sorting your collection into categories is effortless.
All thanks to **Valéry Febvre**(developer of Komikku) we have another useful Linux app. You can consider donating to the project if you like the application.
*Which comic book reader do you use? Will you give Komikku a try? Kindly let me know your thoughts in the comments below.*
--------------------------------------------------------------------------------
via: https://itsfoss.com/komikku-manga-reader/
作者:[Anuj Sharma][a]
选题:[lkxed][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/anuj/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/best-comic-book-reader-linux/
[2]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-library.png
[3]: https://itsfoss.com/best-linux-desktop-environments/
[4]: https://itsfoss.com/best-ebook-readers-linux/
[5]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-online-servers.png
[6]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-reader.png
[7]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-mobile-view.png
[8]: https://flathub.org/apps/details/info.febvre.Komikku
[9]: https://itsfoss.com/flatpak-guide/
[10]: https://itsfoss.com/wp-content/uploads/2022/09/install-komikku-gnome-software.png
[11]: https://gitlab.com/valos/Komikku
[12]: https://valos.gitlab.io/Komikku/

View File

@ -0,0 +1,164 @@
[#]: subject: "Linux Mint 21 Review: Still Fresh and Easiest Distro to Try"
[#]: via: "https://www.debugpoint.com/linux-mint-21-review/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Linux Mint 21 Review: Still Fresh and Easiest Distro to Try
======
Heres the detailed review and benchmark of Linux Mint 21 “Vanessa”.
### Introduction
Linux Mint 21 arrived on July 31, 2022, with two years of updates after its predecessor Linux Mint 20 Ulyana. Two years is a long time in software. A lot has happened since then. Although Linux Mint 21 Vanessa is based on Ubuntu 22.04 at its core, its still different.
Mint devs diverged away from the certain decisions of Ubuntu for the benefit of its users. In that sense, Linux Mint still “just works” for everyone, for almost all hardware, to this very day.
In this review article, I will discuss how Linux Mint 21 performed in two bare metal test setups (details below), a benchmark against Ubuntu 22.04 LTS GNOME and some user feedback.
### Linux Mint 21 Feature Check
Before I go over the review items, a quick recap on the new features of this version compared to the past release.
Linux Mint 21 is based on Ubuntu 22.04 LTS and features the LTS mainline Kernel 5.15. Thats about at the core.
Other than that, there are some unique updates arriving in the desktop, settings and several places. In this release, you get the default support for WebP image format, a changed desktop settings section with more improved groupings and much-needed driverless printing support via Internet Printing Protocol (IPP).
In addition, two important change which is worth highlighting in this release. Although it is based on Ubuntu, Mint never follow what Ubuntu tries to push via “user-centric features”.
So, Linux Mint 21 is completely free of Snap. Firefox is good old vanilla Debian package which you get by default. Flatpak is installed by default, and the controversial Out of memory from Systemd is also disabled.
These are the key differences and improvements compared to the prior release and Ubuntu 22.04. A detailed feature walk-through is available [here][1] if you want to give it a read.
### Bare metal install and review
**Testbed 1 (new hardware)**
* AMD RYZEN 7 (5000 Series), AMD RAEDON Graphics with SSD and 14 GB RAM
* Triple boot with Windows 11, Fedora 35
**Testbed 2 (older hardware)**
* Intel Core i3, NVIDIA CUDA GeForce (350) with SSD and 4GB RAM
* Triple boot with Debian, KDE Neon
### Test Results
Testing for this review is done on the flagship version, “Cinnamon Edition”, which comes with 2.4 GB of ISO size. The ISO size is pretty standard and not much like Ubuntu which is more than 3 GB.
Linux Mint uses the Ubiquity installer, which is stable, and during installation in both the hardware with dual boot/triple boot all went fine.
GRUB is preserved, and all the operating systems are detected in both systems. I was kind of worried about the Legacy BIOS before installation, but all went well.
Installation time in both the hardware is close to 5 minutes, excluding the partition steps.
After the first login, no surprise I found. Since I have not selected the Wi-Fi connectivity during installation, I had to set it up after the first boot.
Bluetooth, wireless connection to the internet, sound all work well in both old and new hardware.
The printer is one of the important items I always check for distro review. So, I have an HP Deskjet 2300 series printer which worked out of the box in Linux Mint. I am pretty impressed because the same printer doesnt work well in Fedora and Ubuntu without installing HPLIP.
So, thats a win.
Since Linux Mint pre-loads all the necessary software, you do not need to install anything after set up. Its one of the few Linux distros ready to use after installation.
Since Mint devs think about users and community feedback, this version is free of Snap packages. Flatpak is preinstalled, and Firefox is the native deb package.
In addition, Linux Mint 21 also disables the Out of memory situation, which recently created quite an uproar after the Ubuntu 22.04 Jammy Jellyfish release.
### Summary of the results
So, in summary, all the following works well without any crashes or errors in both my test hardware.
* Printer
* Bluetooth (with earphones and external speaker sound output)
* Wi-Fi connection
* Volume controls
* Wireless Mouse and Keyboard Detection
* Wake up from standby (both normal and force lid close)
* External monitor connection with HDMI (separate scaling/resolution in the different monitors)
Finally, I was surprised that Mint detected my ancient NVIDIA GeForce card, which gives me trouble in almost all the distros today since the driver is deprecated.
Overall, excellent and solid performance in basic connectivity and hardware.
Lets talk about some performance metrics.
### Performance
With a basic load (a file manager, terminal, and browse, the older hardware consumes 1 GB of memory which is about 25% of available physical memory. And CPU is at 2 % to 3% on average. Most of the resources are consumed by the Cinnamon desktop and Bluetooth agent.
![Linux Mint performance in older hardware][2]
With a little higher load, the modern hardware performs satisfactorily. With Firefox with ten tabs, one terminal window, file manager, LibreOffice and a Flatpak app it uses around 4GB of memory, and the CPU is identical up to 3%.
![Linux Mint performance in newer hardware][3]
Although the memory usage is a little higher in new hardware, I believe its because of the running applications. The maximum memory is consumed by Firefox in this use case.
### Benchmark against Ubuntu 22.04
I did a benchmark on Geekbench (version 5) of Linux Mint 21 against Ubuntu 22.04 and Fedora 35 KDE. It performed well above that two distributions in the same hardware.
The key points where Mint scores a little less are text rendering and image compression. This is partial, I believe, due to the Muffin of Linux Mint. Muffin may not be close to performant compared to Mutter at this moment. But I hope it soon to be.
A detailed benchmark is available [here][4] (if you want to read it in detail), and a screenshot is below.
![Linux Mint 21 benchmark in Geekbench 5][5]
### Ground report
Features and performance aside, how is this version performing out in the wild?
Unfortunately, the official bug tracker in Linux Mint GitHub is not correctly tagged with the release version. Also, there is no official page listing all the bugs injected/reported after a major release. Too bad for the quality.
Nonetheless, around 66 bugs/issues were [reported][6] between 31-July-2022 (release day) and Sep-8-2022 for Mint and Cinnamon in GitHub.
So, around 1.6 bugs per day.
However, most bugs are related to cosmetic items of Cinnamon desktop, screensaver, Cinnamon themes, animation, etc.
Not many critical bugs to be a showstopper.
The software will always have bugs. Hell, Windows have thousands of bugs in general, even today. But no matter the situation or the error, the overall desktop still works. Your work usually doesnt get stuck for these cosmetic bugs.
I also checked the official Mint forum, Reddit and Facebook Mint groups the same issues users reported related to cosmetic items.
### Wrapping up
Linux Mint is for average users, migrated users and for first timers. I believe, Linux Mint developers did a good job by keeping this vision untouched in Linux Mint 21, by carefully bypassing difficult decisions by Ubuntu.
From the Linux adaptation standpoint, it does work, still today. A go-to distribution for all use cases.
Yes, there are minor errors and bugs, but they dont get in the way. An experienced user always finds a way around it. New users can continue their work in Mint without worrying much about Linux.
I believe I can term this release as “Ubuntu done right”.
That said, you can download the latest version from the [official website][7].
[Next: Connect to Ubuntu 20.04 from Windows 10 [Beginners Guide]][8]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/linux-mint-21-review/
作者:[Arindam][a]
选题:[lkxed][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/lkxed
[1]: https://www.debugpoint.com/linux-mint-21-features/
[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Linux-Mint-performance-in-older-hardware.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2022/09/Linux-Mint-performance-in-newer-hardware.jpg
[4]: https://browser.geekbench.com/v5/cpu/compare/15728414?baseline=17124930
[5]: https://www.debugpoint.com/wp-content/uploads/2022/09/Linux-Mint-21-benchmark-in-Geekbench-5.jpg
[6]: https://github.com/linuxmint/cinnamon/issues
[7]: https://www.linuxmint.com/download.php
[8]: https://www.debugpoint.com/connect-ubuntu-20-04-windows-10/

View File

@ -0,0 +1,140 @@
[#]: subject: "Connect to WiFi Using Terminal in Arch Linux and Other Distros"
[#]: via: "https://www.debugpoint.com/connect-wifi-terminal-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Connect to WiFi Using Terminal in Arch Linux and Other Distros
======
This quick guide explains the steps you need to set up and connect to WiFi using a terminal in Arch Linux and other distros.
This guide is ideal for those scenarios where you are stuck with a terminal without any GUI, and no other wired internet connectivity is available. These steps help you to manually detect the wireless card, and device and connect to the WiFi hotspot with password authentication via terminal.
This guide uses [iwd][1] (Net Wireless Daemon) to connect to WiFi via a terminal.
### Connect to WiFi Using Terminal in Arch Linux and Other Distros
#### 1. Setup iwd
The `iwd` package comes with three main modules:
**iwctl** : The wireless client**iwd**: The Daemon**iwmon** : Monitoring tool
On the terminal type
```
iwctl
```
![iwctl Prompt][2]
If you get a command not found, then you need to download the package from [here][3].
So get help from any other system/laptop with an internet connection to download and install the package via mounting the USB.
Alternatively, if you have a USB dongle with the internet, then plugin that into your system. And install via the below commands.
The USB dongle should work out of the box in Arch and most Linux systems today to connect to the internet.
**Arch**
```
pacman -S iwd
```
**Debian, Ubuntu, and other similar distributions**
```
sudo apt-get install iwd
```
**Fedora**
```
sudo dnf install iwd
```
If you get an `iwctl` prompt (like below), then proceed to the next step.
#### 2. Configure
Run the below command to get your systems **wireless device name**.
```
device list
```
![iwctl device list][4]
To **get the list of WiFi networks**, run the below command. Replace `wlan0` with your device name on the below command and all the following commands.
```
station wlan0 get-networks
```
![iwctl available networks][5]
The command gives you the list of available WiFi network with security type and signal strength.
#### Connect
To **connect to the WiFi networ**k, run the below command with the WiFi access point name from the above “get-networks” command.
```
station wlan0 connect
```
Enter your WiFi password when prompted.
![connect to WiFi using iwctl][6]
If all, goes well you should be connected to the internet.
### Usage Guides
* You can check the connection using a simple ping command as follows. The ping replies successful packet transfers for a stable connection.
```
ping -c 3 google.com
```
* You can also check the status of the connection using the below command.
```
station wlan0 show
```
* The iwd keeps the configuration file at `/var/lib/iwd` as a `.psk` file with your access point name.
* This file contains a hash file that is generated using the password and SSID of your WiFi network.
* Press `CTRL+D` to leave from the `iwctl` prompt.
### Wrapping Up
I hope this guide helps you to connect to the internet via the terminal. This helps when you have no other way to connect to WiFi. For example, if you are installing Arch Linux in a stand-alone system (not a VM), you need to connect to the internet to download packages via a terminal using `pacman`.
If you face any trouble, mention the error messages in the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/connect-wifi-terminal-linux/
作者:[Arindam][a]
选题:[lkxed][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/lkxed
[1]: https://wiki.archlinux.org/index.php/Iwd
[2]: https://www.debugpoint.com/wp-content/uploads/2020/11/iwctl-Prompt.jpg
[3]: https://www.archlinux.org/packages/?name=iwd
[4]: https://www.debugpoint.com/wp-content/uploads/2020/11/iwctl-device-list-2.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2020/11/iwctl-available-networks.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2020/11/connect-to-WiFi-using-iwctl.jpg

View File

@ -1,176 +0,0 @@
[#]: subject: "The Basic Concepts of Shell Scripting"
[#]: via: "https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/"
[#]: author: "Sathyanarayanan Thangavelu https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/"
[#]: collector: "lkxed"
[#]: translator: "FYJNEVERFOLLOWS"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
有关 shell 脚本的一些基本概念
======
如果你希望自动执行常规任务并使你的生活更轻松,那么使用 shell 脚本是一个很好的选择。本文将向你介绍一些基本概念,这些概念将帮助你编写高效的 shell 脚本。
![Shell-scripting][1]
shell 脚本是一种被设计用来运行命令行解释器 UNIX shell 的计算机程序。shell 脚本的各类变种被认为是脚本语言。shell 脚本执行的典型操作包括文件操作、程序执行和文本打印。设置环境、运行程序并执行任何必要的清理或日志记录的脚本称为封装。
### 识别 shell 命令提示符
你可以通过查看终端窗口中的提示符符号来识别 Linux 系统的计算机上的shell 命令提示符的用户是普通用户还是超级用户。`#` 符号用于超级用户,`$` 符号用于具有标准权限的用户。
![Figure 1: Manual of date command][2]
### 基本命令
该脚本附带了很多可以在终端窗口上执行的命令,以管理您的计算机。每个命令的详细信息可以在该命令附带的使用手册中找到。你可以使用如下命令来查看手册:
```
$man <command>
```
一些常用的命令有:
```
$date # 显示当前日期和时间
$cal # 显示当前月份日历
$df # 显示磁盘使用情况
$free # 显示内存使用情况
$ls # 列出文件和目录
$mkdir # 创建目录
```
每个命令都附带了几个可以一起使用的选项。你可以参考使用手册以了解更多的细节。`$man date` 的输出如图 1 所示。
### 重定向操作符
当你希望捕获文件中的命令输出或重定向到文件时,可以使用重定向操作符。
| 命令 | 描述 |
| :- | :- |
| $ls -l /usr/bin >file | 默认标准输出到文件 |
| $ls -l /usr/bin 2>file | 重定向标准错误到文件 |
| $ls -l /usr/bin > ls-output 2>&1 | 重定向标准错误和标准输出到文件 |
| $ls -l /usr/bin &> ls-output | 重定向标准错误和标准输出到文件 |
| $ls -l /usr/bin 2> /dev/null | 写入 /dev/null 丢弃输出 |
### 大括号扩展
大括号扩展是 UNIX 提供的强大选项之一。它有助于在一行指令中使用最少的命令完成大量操作。例如:
```
$echo Front-{A,B,C}-Back
Front-A-Back, Front-B-Back, Front-C-Back
```
```
$echo {Z..A}
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
```
```
$mkdir {2009..2011}-0{1..9} {2009..2011}-{10..12}
```
这条命令会为 2009 到 2011 年里的每个月建立一个目录。
### 环境变量
环境变量是一个动态命名的值,它可以影响计算机上运行的进程的行为方式。此变量是进程运行环境的一部分。
| 命令 | 描述 |
| :- | :- |
| printenv | 打印出所有环境变量的值。 |
| set | 设置 shell 选项 |
| export | 导出环境到随后执行的程序 |
| alias | 为命令创建别名 |
### 网络命令
网络命令对于排查网络问题和检查连接到客户机的特定端口非常有用。
| 命令 | 描述 |
| :- | :- |
| ping | 发送 ICMP网际网路控制讯息协定数据包 |
| traceroute | 打印数据包在网络中的路径 |
| netstat | 打印网络连接信息、路由表、接口数据 |
| ftp/lftp | 互联网文件传输程序 |
| wget | 非交互式网络下载器 |
| ssh | OpenSSH SSH 客户端 (远程登录程序) |
| scp | 安全拷贝 |
| sftp | 安全文件传输程序 |
### Grep 命令
Grep 命令用于查找系统和日志中的错误。它是 shell 拥有的强大工具之一。
| 命令 | 描述 |
| :- | :- |
| grep -h '.zip' file.list | `.` 表示任意字符 |
| grep -h '^zip' file.list | 以 `zip` 开头 |
| grep -h 'zip$' file.list | 以 `zip` 结尾 |
| grep -h '^zip$' file.list | 只含有 `zip` |
| grep -h '[^bz]zip' file.list | 不含 `b``z` |
| grep -h '^[A-Za-z0-9]' file.list | 所有文件名有效的文件 |
### 量词
下面是一些量词的例子:
| 命令 | 描述 |
| :- | :- |
| ? | 匹配出现 0 次或 1 次的元素 |
| * | 匹配出现 0 次或多次的元素 |
| + | 匹配出现 1 次或多次的元素 |
| {} | 匹配出现特定次数的元素 |
### 文本处理
文本处理是当今 IT 世界中的另一项重要任务。程序员和管理员可以使用这些命令来切片、剪切和处理文本。
| 命令 | 描述 |
| :- | :- |
| cat -A $FILE | 显示 `$FILE` 文件的所有内容 |
| sort file1.txt file2.txt file3.txt > final_sorted_list.txt | 一次性将所有文件排序 |
| ls - l \| sort -nr -k 5 | 按指定的第 5 列进行排序 |
| sort --key=1,1 --key=2n distor.txt | 对第 1 列进行排序(默认按字母表顺序),对第 2 列进行数值排序 |
| sort foo.txt \| uniq -c | 查找重复的行并显示该行重复的次数 |
| cut -f 3 distro.txt | 剪切第 3 列 |
| cut -c 7-10 | 剪切 7 - 10 字符 |
| cut -d : -f 1 /etc/password | delimiter : |
| sort -k 3.7nbr -k 3.1nbr -k 3.4nbr distro.txt | 按第 3 列第 7 个字符、第 3 列第 1 个字符和第 3 列第 4 个字符排序 |
| paste file1.txt file2.txt > newfile.txt | 合并两个文件 |
| join file1.txt file2.txt | 按公共字段连接两个文件 |
### 窍门和技巧
在 Linux 中,我们可以通过使用简单的命令或控制选项返回到命令的历史记录。
| 命令 | 描述 |
| :- | :- |
| clear | 清空屏幕 |
| history | 保存命令的历史记录 |
| script filename | 捕获文件中的所有命令执行 |
小贴士:
```
History : CTRL + {R, P}
!!number : command history number
!! : last command
!?string : history containing last string
!string : history containing last string
export HISTCONTROL=ignoredups
export HISTSIZE=10000
```
随着你对 Linux 命令逐渐熟悉,你将能够编写封装脚本。所有手动任务,如定期备份、清理文件、监控系统使用情况等,都可以使用脚本自动完成。在学习高级概念之前,本文将帮助您开始编写脚本。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/
作者:[Sathyanarayanan Thangavelu][a]
选题:[lkxed][b]
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Shell-scripting.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Manual-of-date-command.jpg

View File

@ -0,0 +1,81 @@
[#]: subject: "How to Apply Accent Colour in Ubuntu Desktop"
[#]: via: "https://www.debugpoint.com/ubuntu-accent-colour/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "yjacks"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Ubuntu 桌面中应用重点色
======
因为最近的开发者们的贡献,在 Ubuntu 中使用自己的重点色是很简单的。
每个 Linux 发行版都有它们默认的主题,带来了它们的不尽相同的重点色。重点色用于在每个设置中高亮主题色。通常,主题色和重点色被用来完善它们彼此。
在最近的 GNOME 桌面的更新之后Ubuntu 桌面在 22.04 LTS 版本中引入了重点色。
尽管它们如何应用是显而易见的,但是为了 Linux 的新手,我将解释如何在 Ubuntu 桌面中使用重点色。
### 在 Ubuntu 桌面中应用重点色
1. 从应用菜单中打开系统设置
2. 进入<ruby>外观<rt>Appearance</rt></ruby> 菜单
3. 在<ruby>风格<rt>Style</rt></ruby>菜单下,你应该捡到一套预设的颜色。
4. 选择其中的一个来改变重点色。
一旦更改,重点色将被应用到 GTK 应用选项中例如GTK 控件,像是切换按钮和文件夹的默认外观。
默认的重点色是橙色,有十种颜色可供选择,具体如下。
* 橙色
* Bark
* Sage
* 橄榄绿
* 铬绿
* 普鲁士绿
* 蓝色
* 紫色
* 品红
* 红色
![Accent Colour in Ubuntu][1]
译注Bark是一种棕色Sage是一种灰绿色。
你应该记住一点,明亮或者黑暗的主题所有的重点色组合可能改变你的桌面的整体外观。
以上的特性只是只适用于目前使用 GNOME 桌面的 Ubuntu而不能用于其它提供 GNOME 的发行版,例如 Fedora Workstation。因为有一些内容是由 Ubuntu 团队开发的,并且并没有合并到 GNOME 上游。
### Kubuntu 中的重点色
使用带有 KDE Plasma 桌面的 Kubuntu你可以简单地使用重点色。KDE Plasma 也提供了预设的颜色和自定义的颜色选择器选项。另外,自 KDE Plasma 5.25 起,重点色可以依据壁纸来改变。
为了在 Kubuntu 中改变它,跟着下面的步骤走:
* 在应用菜单中打开系统设置。
* 进入外观> 全局主题> 颜色标签。
* 选择你的重点色
![KDE Plasma 5.25 - Accent Colour Change Based on wallpaper][2]
我知道 Lubuntu 与 Xubuntu 并没有这个特性。而且它不太可能很快到来。
使用愉快。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/ubuntu-accent-colour/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[yjacks](https://github.com/yjacks)
校对:[校对者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/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/Accent-Colour-in-Ubuntu.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/KDE-Plasma-5.25-Accent-Colour-Change-Based-on-wallpaper-1024x611.jpg
[3]: https://t.me/debugpoint

View File

@ -0,0 +1,94 @@
[#]: subject: "How to Enable Dark Mode in Web Browser"
[#]: via: "https://www.debugpoint.com/dark-mode-browser/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在网络浏览器中启用深色模式
======
指南旨在帮助你了解如何在流行的网络浏览器如Firefox、Google Chrome、Chromium 和 Microsoft Edge 中启用深色模式。
我们都喜欢深色模式。许多人喜欢它,而不是标准的浅色模式。虽然许多桌面应用提供了原生的深色模式,但一些应用通过桌面环境的基础模式适应深色模式。
你不能否认,我们都在网络浏览器上花了几个小时。我们很少使用桌面应用(除非你是在工作,如视频编辑等)。因此,当你花很多时间在浏览器上阅读和学习时,你总是可以选择深色模式。但是,来到网络浏览器,事情就有点不同了。
本指南为你提供简单的步骤,你可以按照这些步骤在 Mozilla Firefox、Chromium、Google Chrome 和 Edge 浏览器中启用深色模式。
### 在网络浏览器中启用深色模式
#### 在 Firefox中启用深色模式
* 打开 Firefox ,点击右上角的设置菜单。
* 点击 `设置 > 扩展和主题`
* 选择`深色主题`并点击`启用`。然后你应该看到深色模式被应用到 Firefox。
![Enable dark mode in Firefox][1]
![Firefox in Dark Mode][2]
* 要恢复它,按照同样的步骤,选择浅色主题。
#### Chromium 和 Google Chrome 的深色模式
Chromium 或 Google Chrome 默认不预装任何深色主题。因此,你需要去 Chrome 网络商店,下载任何你想要的深色主题。在本指南中,我将推荐 “Morpheon Dark” 主题,它有超过一百万用户在使用它。
从 Chromium 浏览器中打开 Morpheon Dark 主题页面(从以下链接)。
[Chrome 网络商店中的 Morpheon Dark 主题][3]
点击“添加到 Chrome” 按钮。它应该会在 Chrome 中启用。
你可能想探索 Chrome 网络商店中的其他黑白或深色主题。[请访问此页面,查看所有的深色主题集合][4] 。
然而,你应该记住一件事:这个主题不会改变设置或上下文菜单。这很明显。因为它只是改变了浏览器窗口,而那些菜单是操作系统本身的一部分(有时)。
![Chromium Dark Theme][5]
对 Google Chrome 也要按照同样的步骤进行。
#### Edge 浏览器的深色模式
然而,[Microsoft Edge 浏览器][6]默认带有更好的深色主题。它允许你从设置中使用 GTK+、浅色和深色模式。
* Open Edge Browser
* Click on the three little dots on the right-top side.
* Go to Appearance and choose Dark. And you should be all set.
* 打开 Edge 浏览器
* 点击右上角的三个小圆点。
* 进入外观,选择深色。这就完成了。
这个 Edge 的深色主题实现得更好,因为它改变了上下文菜单和地址栏。
![Edge in Dark Theme][7]
### 结束语
如果你是一个高级用户,你可能不需要这个指南。你可以搞清楚。
但我们为所有的读者涵盖了所有从基础到高级的教程。许多新的 Linux 用户可能也不知道如何在浏览器中启用深色模式。
因此,话虽如此,我希望这能帮助你和其他人。如果你遇到任何麻烦,请在下面的评论栏里告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/dark-mode-browser/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者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/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2021/10/Enable-dark-mode-in-Firefox.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/Firefox-in-Dark-Mode-1024x423.jpg
[3]: https://chrome.google.com/webstore/detail/morpheon-dark/mafbdhjdkjnoafhfelkjpchpaepjknad?hl=en-GB
[4]: https://chrome.google.com/webstore/category/collection/dark_themes
[5]: https://www.debugpoint.com/wp-content/uploads/2021/10/Chromium-Dark-Theme-1024x463.jpg
[6]: https://www.debugpoint.com/2020/10/how-to-install-edge-ubuntu-linux/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/10/Edge-in-Dark-Theme-1024x541.jpg