Merge pull request #3 from LCTT/master

update frome LCTT
This commit is contained in:
北梦南歌 2022-04-03 19:07:56 +08:00 committed by GitHub
commit 2c1f3fbe69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 177 additions and 163 deletions

View File

@ -1,32 +1,33 @@
[#]: collector: (lujun9972)
[#]: translator: (lkxed)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-14427-1.html)
[#]: subject: (Linux Jargon Buster: What is Grub in Linux? What is it Used for?)
[#]: via: (https://itsfoss.com/what-is-grub/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
Linux 术语克星Linux 中的 Grub 是什么?它有什么用
Linux 黑话解释Linux 中的 GRUB 是什么
======
![](https://img.linux.net.cn/data/attachment/album/202204/03/111835u4rcmcf7qze8pawa.png)
如果你曾经使用过 Linux 桌面,你一定见过这个屏幕。这就是所谓的 GRUB 屏幕。是的,它的字母全部都是大写的。
![Remember this screen? This is GRUB][1]
在 “<ruby>Linux 术语克星<rt>Linux Jargon Buster</rt></ruby>”系列的这一个章节中,我将告诉你 Grub 是什么,以及它有什么用处。此外,我还会简要地介绍一下配置和定制的部分。
在 “<ruby>Linux 黑话解释<rt>Linux Jargon Buster</rt></ruby>”系列的这一个章节中,我将告诉你 GRUB 是什么,以及它有什么用处。此外,我还会简要地介绍一下配置和定制的部分。
### GRUB 是什么?
GRUB[2] 是一个用于加载和管理系统启动的完整程序。它是 Linux 发行版中最常见的引导程序。引导程序是计算机启动时运行的第一个软件。它加载 [操作系统的内核][3],然后再由内核初始化操作系统的其他部分(包括 Shell、[显示管理器][4]、[桌面环境][5] 等等)。
[GRUB][2] 是一个用于加载和管理系统启动的完整程序。它是 Linux 发行版中最常见的<ruby>引导程序<rt>bootloader</rt></ruby>。引导程序是计算机启动时运行的第一个软件。它加载 [操作系统的内核][3],然后再由内核初始化操作系统的其他部分(包括 Shell、[显示管理器][4]、[桌面环境][5] 等等)。
### <ruby>引导程序<rt>boot loader</rt></ruby> <ruby>引导管理器<rt>boot manager</rt></ruby>
### 引导程序和引导管理器
我不想现在就把你搞糊涂,但是我认为这个话题是不可避免的。引导程序和引导管理器之间有着一条模糊的界限。
我不想现在就把你搞糊涂,但是我认为这个话题是不可避免的。<ruby>引导程序<rt>boot loader</rt></ruby><ruby>引导管理器<rt>boot manager</rt></ruby>之间有着一条模糊的界限。
你已经知道了引导程序是什么。它会首先启动,然后将内核加载到内存中并执行它。引导管理器则允许你在不同的操作系统之间进行选择(如果你的电脑上不止一个操作系统的话)。引导管理器并不会直接加载系统。
With Linux kernel version 3.3, the [Linux kernel includes a built-in EFI bootloader][6]. In fact, any operating system that is capable of working [EFI system includes an EFI bootloader][7]. In EFI capable systems, the firmware reads the EFI System Partition (ESP) for the EFI files for boot information.
随着 Linux 内核 3.3 版本的推出,[Linux 内核包括了一个内置的 EFI 引导程序][6]。事实上,任何一个[支持 EFI 的系统都包括一个 EFI 引导程序][7]。在支持 EFI 的系统中,固件会读取 <ruby>EFI 系统分区<rt>EFI System Partition</rt></ruby>ESP中的 EFI 文件,从而获得启动信息。
这里插入一张图片,图中显示了带有 ESP 分区的分区表:
@ -35,13 +36,29 @@ With Linux kernel version 3.3, the [Linux kernel includes a built-in EFI bootloa
GRUB 既是一个引导程序,也是一个引导管理器。一会儿我再来谈 GRUB。让我们先看看其他类似 GRUB 的程序。
> 小知识GRUB 是 **GR**and **U**nified **B**ootloader 的首字母缩写。
> 小知识GRUB 是 **GR**and **U**nified **B**ootloader大一统引导程序 的首字母缩写。
### GRUB 屏幕上的那些行是什么意思?
你会在 GRUB 屏幕上看到几行字。这些行对于不同的设置、不同的发行版会有所不同。
通常情况下,第一行是你的 Linux 发行版。如果你看到类似高级选项的东西,你可以进入其中,找到一些以 “linux-generic-x-y-z” 等开头的行。
当你的 Linux 发行版更新内核版本时,它至少会保留一个旧版本。你可以选择启动到旧的 Linux 内核,以防你的系统遇到新更新的 Linux 内核的任何问题。
在基于 Ubuntu 的发行版中,你也可以看到一个恢复选项。
![][8a]
*在高级选项下,通常有一个旧的内核版本和恢复选项*
在最后,你可能会看到一个条目,如系统设置或 UEFI 设置,以访问系统的 BIOS 设置。
### 还有哪些类似 GRUB 的引导管理器?
GRUB 是 Linux 中最流行的引导管理器。但它并不是唯一的一个。有一个高度可定制的引导管理器,名字叫做 [rEFInd boot manager][9],它同样受到了一些 Linux 用户的喜爱。
GRUB 是 Linux 中最流行的引导管理器。但它并不是唯一的一个。有一个高度可定制的引导管理器,名字叫做 [rEFInd 引导管理器][9],它同样受到了一些 Linux 用户的喜爱。
![定制化的 rEFInd Boot Manager 屏幕 | 图片来源kofler.info/pop_os][10]
![定制化的 rEFInd 引导管理器屏幕 | 图片来源kofler.info/pop_os][10]
还有一个基于文本的引导管理器,名字叫做 [systemd-boot][11]。你可以猜到这是专为基于 systemd 的 Linux 发行版准备的。有一些发行版正在使用 systemd-boot比如 Pop OS。
@ -69,16 +86,15 @@ GRUB 是 Linux 中最流行的引导管理器。但它并不是唯一的一个
你必须 [更新 GRUB 才能使这些修改生效][16]。
### Ubuntu 中的 GRUB 定制器
### 使用 GRUB 定制器来定制 GRUB
如果你不太习惯 [在终端里使用文本编辑器编辑文件][17],你可以 [使用一个叫做 GRUB 定制器的图形工具][18]。
它允许你改变启动顺序、默认超时时间等等。你还可以用它来把 GRUB 的背景设置成一张自定义的墙纸。
![][19]
它允许你改变启动顺序、默认超时时间等等。你还可以用它来把 GRUB 的背景设置成一张自定义的墙纸。
遗憾的是,这个工具只适用于基于 Ubuntu 的 Linux 发行版。
GRUB 定制器可以在 Ubuntu 20.04 中从 Universe 仓库安装,在 Ubuntu 18.04 中 [通过 PPA 安装][22]。它可以 [通过 AUR][23] 在基于 Arch Linux 的发行版中使用。
### 总结
@ -101,7 +117,7 @@ via: https://itsfoss.com/what-is-grub/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -110,11 +126,12 @@ via: https://itsfoss.com/what-is-grub/
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/grub-screen-linux.png?resize=800%2C450&ssl=1
[2]: https://www.gnu.org/software/grub/
[3]: https://itsfoss.com/what-is-linux/
[4]: https://itsfoss.com/display-manager/
[5]: https://itsfoss.com/what-is-desktop-environment/
[4]: https://linux.cn/article-12773-1.html
[5]: https://linux.cn/article-12579-1.html
[6]: https://www.rodsbooks.com/efi-bootloaders/efistub.html
[7]: https://jdebp.eu/FGA/efi-boot-process.html
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/disk-partition-gparted.png?resize=744%2C385&ssl=1
[8a]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2012/07/boot-into-recovery-mode-ubuntu-1.jpg?w=635&ssl=1
[9]: https://www.rodsbooks.com/refind/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/refind-boot-manager.png?resize=800%2C602&ssl=1
[11]: https://wiki.gentoo.org/wiki/Systemd-boot
@ -128,3 +145,5 @@ via: https://itsfoss.com/what-is-grub/
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2013/05/make-windows-default-grub-2.jpeg?resize=799%2C435&ssl=1
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/grub-manual-Linux-terminal.png?resize=800%2C462&ssl=1
[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/what_is_GRUB.gif?resize=500%2C343&ssl=1
[22]: https://itsfoss.com/ppa-guide/
[23]: https://itsfoss.com/aur-arch-linux/

View File

@ -0,0 +1,98 @@
[#]: subject: "Deepin OS Becomes the First Linux Distro to Offer Face Unlock"
[#]: via: "https://news.itsfoss.com/deepin-os-20-5-release/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: "lkxed"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14425-1.html"
深度操作系统成为首个支持人脸解锁的 Linux 发行版
======
> 在提供现代桌面体验方面,深度占据了领先地位。
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/deepin-20-5-release.png?w=1200&ssl=1)
在深度问世时,人们都为它纯粹的漂亮界面而惊叹。
随着时间的推移,开发人员越来越有经验,他们把重点转移到了系统设计和功能上,力求在这些方面和其他的商业操作系统看齐,我指的是 Windows 和 macOS。深度是首个支持安卓应用和云同步等功能的发行版。
相信我,这是一件好事情。
Linux 发行版以各种桌面环境的形式向大众提供。深度看起来很主流,可以吸引年轻群体。
中国的深度开发团队的也有相同目标,因此深度发布了 20.5 版本,该版本主要亮点是面部识别。
### 深度操作系统 20.5 的新功能
新版本根据用户的反馈增加了几个功能。稳定的内核版本现在已经升级到 5.15.24,并修复几个错误,以加强系统安全性。
让我们来看看这个版本还有哪些新功能吧。
#### Linux 上有了面部解锁
![][1]
是的,我知道 Linux 上早就有面部解锁的相关消息了。毕竟,我曾经写过一篇关于 [在 Linux 发行版中使用类似 Howdy 的软件来支持面部解锁功能][2] 的详细指南。
然而,那些软件更多的是一种个性化定制,是为那些有经验的、爱折腾的用户准备的。
深度现在提供基于人脸的生物识别认证方法。它可以在有内置摄像头的笔记本电脑上工作。
你需要先在控制中心录入人脸信息,此后,你就可以用你的人脸 ID 登录系统。
#### 用户可在应用商店中反馈
你现在可以直接在应用商店中提交对某个应用的反馈。
![][3]
这还不算完。当你有应用程序的安装和更新问题时,你可以在应用程序中直接向官方支持提交问题,并获得解决方案(如果开发者提供了的话)。
#### 改进的邮件应用
![][4]
深度邮件应用现在支持了自定义文件夹管理。它还可以在网络重新连接后自动接收邮件。邮件应用的框架和插件已经替换成了当下流行的 Vue + TinyMCE。
现在,你可以通过点击系统通知直接跳转到到新邮件。为提高工作效率,你可以置顶常用邮件与合并邮件。你也可以预览邮件附件。
#### 可以“钉住”的屏幕截图
![][5]
你现在可以使用内置的屏幕截图工具来“钉住”截图。这样一来,捕获的屏幕截图就会固定在其他应用程序窗口的顶部。从而,你可以同时使用其他应用程序,以提高你的工作效率。另外,置顶的屏幕截图是可以移动的。
#### 其他变化
下面是 Deepin 20.5 新版本中的一些其他变化:
* Linux 稳定内核更新到了 5.15.24
* 可以为一个有线网络适配器设置多个 IP
* 优化了无线网络的密码认证交互
* 系统搜索现在可以使用文件类型和扩展名作为关键词
* 设备管理器允许你禁用或启用设备
* 浏览 docx 文件的文档查看器得到了性能优化
还有许多我没有提到的小功能和改进。你可以在 [版本发布说明][6] 中了解这些内容。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/deepin-os-20-5-release/
作者:[Abhishek][a]
选题:[lujun9972][b]
译者:[lkxed](https://github.com/lkxed)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/face-unlock-deepin.jpg?w=900&ssl=1
[2]: https://itsfoss.com/face-unlock-ubuntu/
[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/app-store-feedback-deepin.webp?resize=1568%2C980&ssl=1
[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/deepin-mail-app.webp?w=900&ssl=1
[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/pinned-screenshots-deepin.webp?w=900&ssl=1
[6]: https://www.deepin.org/en/2022/03/31/deepin-20-5/

View File

@ -1,94 +0,0 @@
[#]: subject: "Deepin OS Becomes the First Linux Distro to Offer Face Unlock"
[#]: via: "https://news.itsfoss.com/deepin-os-20-5-release/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Deepin OS Becomes the First Linux Distro to Offer Face Unlock
======
When Deepin first arrived at the scene, it blew away people with its sheer beautiful interface.
As the time progressed and developers got more experienced, their focus shifted to include design and features users find in other commercial desktop OS offerings, i.e., Windows and macOS. Deepin was the first distro to offer Android apps support, cloud sync option and more.
And trust me, thats for good.
Linux distributions have a variety of offerings in the form of various desktop environments. Deepin looks mainstream that could attract a younger crowd.
Keeping the same goal in mind, China based Deepin developers have released the version 20.5 and its main highlight is facial recognition.
### New features in Deepin 20.5
The new version has added several features based on the user feedback. The stable kernel version is now upgraded to 5.15.24 with several bug fixes to enhance security.
Lets see what else is new in this release.
#### Face unlock comes to Linux
![][1]
I know things like this already exist on the horizon. After all, I wrote a detailed guide on [adding face unlock feature in Linux distributions using programs like Howdy][2].
However, those things were more DIY, additional stuff for experienced and intriguing users.
Deepin is now offering the face-based biometric authentication method. It should work on laptops with in-built webcam.
Once you enrol your face in the Control Center, you can log in to the system with your face ID from next time onwards.
#### Easy user feedback collection in App Store
You can now easily send feedback on an application from the App Store directly.
![][3]
Thats not it. When you have app installation and update problems, you can submit the issues on the app page directly to the official support and get solutions (if the developer provides it).
#### Improved Mail app
![][1]
Deepin Mail apps now supports custom folder management. It can also automatically receive emails after network reconnection. The framework and plugins have been replaced with the popular vue+tinymce.
You can now hump to new emails directly by clicking system notifications. For better productivity, you can stick common emails and aggregated emails on top. Email attachments can also be previewed.
#### Pinned screenshots
![][1]
The in-built screenshot tools now lets you pin the screenshots. This way the captured screenshot remains on top of other application windows. This way you can use other apps at the same time and thus increase your efficiency. And yes, the pinned screenshots position can be moved.
#### Other changes
Here are some other changes in the new Deepin 20.5 release:
* Stable kernel is updated to 5.15.24
* Multiple IPs can be set for a single wired network adapter
* Password authentication interaction for wireless networks is optimized
* System search can now use file types and extensions as keywords
* Device manager allows you to disable or enable devices
* Document viewer performance for viewing DOCX files is optimized
There are more small features and improvements here and there. You may read about them in the [release notes][4].
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/deepin-os-20-5-release/
作者:[Abhishek][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://itsfoss.com/face-unlock-ubuntu/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://www.deepin.org/en/2022/03/31/deepin-20-5/

View File

@ -2,120 +2,111 @@
[#]: via: "https://fedoramagazine.org/using-sourcegraph-to-search-34000-fedora-repositories/"
[#]: author: "Justin Dorfman https://fedoramagazine.org/author/jdorfman/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Using Sourcegraph to Search 34,000+ Fedora Repositories
使用 Sourcegraph 搜索 34,000 多个 Fedora 仓库
======
![][1]
Photo by [Markus Winkler][2] on [Unsplash][3]
照片由 [Unsplash][3] 上的 [Markus Winkler][2] 提供
In October 2021, a Fedora Linux user [asked a question about licensing][4]. Fedora Project Leader Matthew Miller [left a response][5]: “Since we dont have a complete, exploded, searchable repository of all of the packages in Fedora, I dont have a quick way to check.” 
在 2021 年 10 月,一个 Fedora Linux 用户 [问了一个关于许可的问题][4]。Fedora 项目负责人 Matthew Miller [回复道][5]:“我不能快速地检查(这个问题),因为我们没有一个收录完整、使用广泛、可搜索的存储库来检索 Fedora 中所有软件包。”
[Followed by][6]: “…or possibly pay Sourcegraph to do it for us. They seem like nice people.” He is correct, we (Sourcegraph) _are_ nice people, but we dont want your money. Instead, we wanted to team up with the Fedora community.
[接着他说][6]"......或许我们可以付钱给 Sourcegraph让他们帮我们做这个。他们看起来是很好的人。" 他是对的我们Sourcegraph的确是好人但我们不想要你的钱。相反我们想与 Fedora 社区合作。
The Fedora Community can now search their universe of open source code—currently over 34,000 repositories and counting.
Fedora 社区现在可以在他们的开源代码宇宙中尽情搜索 —— 目前有超过 34,000 个存储库,而且还在不断增加。
### Introduction to code search
### 代码搜索简介
For those who arent familiar with the concept of [code search][7], it enables teams to onboard to a new codebase and find answers faster, helps to identify security risks, and many other use cases. Sourcegraph has indexed over two-million repositories across multiple code hosts such as GitHub and GitLab. **This article is going to focus strictly on code search for _src.fedoraproject.org_.** Sourcegraph provides both a [web app][8] and [CLI][9] interface.
如果你还不熟悉 [代码搜索][7] 的概念我现在就来告诉你。代码搜索可以让团队更快地适应一个新的代码库并在里面找到答案帮助团队识别安全风险以及许多其他用例。Sourcegraph 已经在 GitHub 和 GitLab 等多个代码托管服务上,索引了 200 多万个存储库。本文只关注 src.fedoraproject.org 的代码搜索。Sourcegraph 同时提供了一个 [Web 应用][8] 和 [命令行客户端][9]。
### Using the Web app
### 使用 Web 应用
When using the Sourcegraph [web app][8] you will need to start each search with **repo:^src.fedoraprojects.org** before entering any search queries. Using this link to the [web app][8] will include this initial string as shown here:
在使用 Sourcegraph [Web 应用][8] 时,你需要先输入初始字符串 `repo:^src.fedoraprojects.org`,然后再开始查询。这个 [Web 应用][8] 链接中包括了上面的初始字符串,点击这个链接后,搜索界面如下图所示:
![Sourcegraph web app interface][10]
![Sourcegraph Web 应用界面][10]
The following sections will provide some web app examples of searches that might be of interest.
下面我将提供几个使用 Web 应用程序进行搜索的例子,大家可能会对它们感兴趣。
#### Find repositories using popular OSI-approved licenses 
#### 查找使用流行的 <ruby>经 OSI 批准的<rt>OSI-approved</rt></ruby> 许可证的存储库
The following query will scan all the repositories for software that is compatible with the “Open Source Definition” (OSD).
下面的查询语句将扫描所有兼容 “<ruby>开源定义<rt>Open Source Definition</rt></ruby>OSD 的软件存储库。
```
repo:^src.fedoraproject.org/ lang:"RPM Spec" License: ^.*apache|bsd|gpl|lgpl|mit|mpl|cddl|epl.*$
```
![License search][11]
![许可证搜索][11]
[Try it!][12]
[试试吧!][12]
#### Find files with TODOs
#### 查找带有 TODO 的文件
The following query can find TODOs in 34k repositories. This is great for those looking to contribute to projects that need help.
下面的查询语句将在 34,000 多个仓库中找到 TODO。对于那些希望为需要帮助的项目做出贡献的人来说是一个非常棒的功能。
```
repo:^src.fedoraproject.org/ "TODO"
```
![Search for TODO][13]
![搜索 TODO][13]
[Try it!][14]
[试试吧!][14]
#### Find files being served via FTP
#### 查找 FTP 服务器上的文件
A co-worker of mine from back in the day told me “FTP is a dead protocol”. Is it? You can add to this query to find any other protocol such as irc, https, etc.
我的一个前同事告诉我 “FTP是一个死的协议”。真的是这样吗你也可以在这个查询中加入任何其他协议如 irc、https 等。
```
repo:^src.fedoraproject.org/ (?:ftp)://[A-Za-z0-9-]{0,63}(.[A-Za-z0-9-]{0,63})+(:d{1,4})?/*(/*[A-Za-z0-9-._]+/*)*(?.*)?(#.*)?
```
![Search for protocol][15]
![搜索协议][15]
[Try it!][16]
[试试吧!][16]
#### Find files with a vulnerable version of Log4j
#### 查找使用有漏洞的 Log4j 版本的文件
This query will find any files that are possibly vulnerable (false positives can happen) to CVE-2021-44228 aka Log4j. You can also search for other vulnerabilities that can then be reported to project maintainers.
这个查询语句将找到任何可能存在 CVE-2021-44228也就是 Log4j漏洞的文件可能会有误报。你也可以搜索其他漏洞然后报告给项目维护者。
```
repo:^src.fedoraproject.org/ org.apache.logging.log4j 2.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(.[0-9]+)) count:all
```
![Search for log4j][17]
![搜索 log4j][17]
[Try it!][18]
[试试吧!][18]
### Use the CLI
### 使用命令行
Sourcegraph also has a command-line interface tool called [src][19], which allows you to do everything I just mentioned above, plus other useful commands like getting results in JSON for programmatic consumption.
Sourcegraph 还有一个叫做 [src][19] 的命令行客户端,它可以让你完成我刚才提到的所有事情。此外,它还有其他一些有用的命令。比如说,它可以把结果用 JSON 格式输出,方便你在编程中使用。
```
src search -json 'repo:^src.fedoraproject.org/ lang:"RPM Spec" License: ^.*apache|bsd|g
pl|lgpl|mit|mpl|cddl|epl.*$'
```
#### JSON output
#### 输出 JSON
![JSON output][20]
![输出 JSON][20]
[Try it!][21]
[试试吧!][21]
### Search Syntax
### 搜索语法
The examples shown may be a good starting point but are by no means the only queries that may be made. You can [view all search query syntaxes][22] and create your own as needed.
就入门而言,上面的例子是很好的起点,但 Sourcegraph 还支持更多的查询语句。你可以 [查看所有的搜索查询语法][22],并根据需要创建你自己的查询语句。
### Conclusion
As you can see, with Sourcegraph, the Fedora Linux community can now quickly search for all code hosted at [src.fedoraproject.org][23], regardless of whether they are literal or complex regex queries.
### 总结
I appreciate the Fedora Linux community being so helpful and welcoming. If you have anything you want to add or questions, my team and I will be in the comments section below. You can also [join us on Slack][24].
正如你所看到的,有了 SourcegraphFedora Linux 社区现在可以快速搜索托管在 [src.fedoraproject.org][23] 上的所有代码,无论是使用普通查询还是复杂的正则查询。
Special thanks to [Vanesa Ortiz][25] for [making this collaboration happen][26], [Ben Venker][27] for his help fixing my broken regex (multiple times), as well as [Rebecca Dodd][28] and [Nick Moore][29] for their help with editing.
感谢 Fedora Linux 社区的慷慨帮助和热情欢迎。如果你有任何想补充的内容或问题,我和我的团队都会在下面的评论区回复。你也可以 [在 Slack 上找到我们][24]。
特别感谢 [Vanesa Ortiz][25] 促成了这次合作,还有 [Ben Venker][27] 帮助修复了我的正则表达式(多次),以及 [Rebecca Dodd][28] 和 [Nick Moore][29] 在编辑上的帮助。
--------------------------------------------------------------------------------
@ -123,7 +114,7 @@ via: https://fedoramagazine.org/using-sourcegraph-to-search-34000-fedora-reposit
作者:[Justin Dorfman][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[lkxed]](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出