mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-16 22:42:21 +08:00
Merge pull request #6962 from stevenzdg988/master
下回一定要提交翻译的 PR 和申请的 PR 分成两个来提交。
This commit is contained in:
commit
10939ff290
@ -1,81 +0,0 @@
|
||||
Migrating to Linux: An Introduction
|
||||
======
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/migrating-to-linux.jpg?itok=sjcGK0SY)
|
||||
Computer systems running Linux are everywhere. Linux runs our Internet services, from Google search to Facebook, and more. Linux also runs in a lot of devices, including our smartphones, televisions, and even cars. Of course, Linux can also run on your desktop system. If you are new to Linux, or you would just like to try something different on your desktop computer, this series of guides will briefly cover the basics and help you in migrating to Linux from another system.
|
||||
|
||||
Switching to a different operating system can be a challenge because every operating system provides a different way of doing things. What is second nature on one system can take frustrating time on another as we need to look up how to do things online or in books.
|
||||
|
||||
### Vive la difference
|
||||
|
||||
To getting started with Linux, one thing you'll likely notice is that Linux is packaged differently. In other operating systems, many things are bundled together and are just a part of the package. In Linux, however, each component is called out separately. For example, under Windows, the graphical interface is just a part of Windows. With Linux, you can choose from multiple graphical environments, like GNOME, KDE Plasma, Cinnamon, and MATE, to name a few.
|
||||
|
||||
At a high level, a Linux installation includes the following things:
|
||||
|
||||
1. The kernel
|
||||
|
||||
2. System programs and files residing on disk
|
||||
|
||||
3. A graphical environment
|
||||
|
||||
4. A package manager
|
||||
|
||||
5. Applications
|
||||
|
||||
|
||||
|
||||
|
||||
### The Kernel
|
||||
|
||||
The core of the operating system is called the kernel. The kernel is the engine under the hood. It allows multiple applications to run simultaneously, and it coordinates their access to common services and devices so everything runs smoothly.
|
||||
|
||||
### System programs and files
|
||||
|
||||
System programs reside on disk in a standard hierarchy of files and directories. These system programs and files include services (called daemons) that run in the background, utilities for various operations, configuration files, and log files.
|
||||
|
||||
Instead of running inside the kernel, these system programs are applications that perform tasks for basic system operation -- for example, set the date and time and connect on the network so you can get on the Internet.
|
||||
|
||||
Included here is the init program - the very first application that runs. This program is responsible to starting all the background services (like a web server), starting networking, and starting the graphical environment. This init program will launch other system programs as needed.
|
||||
|
||||
Other system programs provide facilities for simple tasks like adding users and groups, changing your password, and configuring disks.
|
||||
|
||||
### Graphical Environment
|
||||
|
||||
The graphical environment is really just more system programs and files. The graphical environment provides the usual windows with menus, a mouse pointer, dialog boxes, status and indicators and more.
|
||||
|
||||
Note that you aren't stuck with the graphical environment that was originally installed. You can change it out for others, if you like. Each graphical environment will have different features. Some look more like Apple OS X, some look more like Windows, and others are unique and don't try to mimic other graphical interfaces.
|
||||
|
||||
### Package Manager
|
||||
|
||||
The package manager used to be difficult for people to grasp coming from a different system, but nowadays there is a similar system that people are very familiar with -- the App Store. The packaging system is really an app store for Linux. Instead of installing this application from that web site, and the other application from a different site, you can use the package manager to select which applications you want. The package manager then installs the applications from a central repository of pre-built open source applications.
|
||||
|
||||
### Applications
|
||||
|
||||
Linux comes with many pre-installed applications. And you can get more from the package manager. Many of the applications are quite good, which others need work. Sometimes the same application will have different versions that run in Windows or Mac OS or Linux.
|
||||
|
||||
For example, you can use Firefox browser and Thunderbird (for email). You can use LibreOffice as an alternative to Microsoft Office and run games through Valve's Steam program. You can even run some native Windows applications on Linux using WINE.
|
||||
|
||||
### Installing Linux
|
||||
|
||||
Your first step is typically to install a Linux distribution. You may have heard of Red Hat, Ubuntu, Fedora, Arch Linux, and SUSE, to name a few. These are different distributions of Linux.
|
||||
|
||||
Without a Linux distribution, you would have to install each component separately. Many components are developed and provided by different groups of people, so to install each component separately would be a long, tedious task. Luckily, the people who build distros do this work for you. They grab all the components, build them, make sure they work together, and then package them up under a single installation.
|
||||
|
||||
Various distributions may make different choices and use different components, but it's still Linux. Applications written to work in one distribution frequently run on other distributions just fine.
|
||||
|
||||
If you are a Linux beginner and want to try out Linux, I recommend[ installing Ubuntu][1]. There are other distros you can look into as well: Linux Mint, Fedora, Debian, Zorin OS, elementary OS, and many more. In future articles, we will cover additional facets of a Linux system and provide more information on how to get started using Linux.
|
||||
|
||||
Learn more about Linux through the free ["Introduction to Linux" ][2]course from The Linux Foundation and edX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
|
||||
|
||||
作者:[John Bonesio][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/johnbonesio
|
||||
[1]:https://www.ubuntu.com/download/desktop
|
||||
[2]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
@ -0,0 +1,129 @@
|
||||
translating by stevenzdg988
|
||||
|
||||
Linux wc Command Explained for Beginners (6 Examples)
|
||||
======
|
||||
|
||||
While working on the command line, sometimes you may want to access the number of words, byte counts, or even newlines in a file. If you are looking for a tool to do this, you'll be glad to know that in Linux, there exists a command line utility - dubbed **wc** \- that does all this for you. In this article, we will be discussing this tool through easy to understand examples.
|
||||
|
||||
But before we jump in, it's worth mentioning that all examples provided in this tutorial have been tested on Ubuntu 16.04.
|
||||
|
||||
### Linux wc command
|
||||
|
||||
The wc command prints newline, word, and byte counts for each input file. Following is the syntax of this command line tool:
|
||||
|
||||
wc [OPTION]... [FILE]...
|
||||
|
||||
And here's how wc's man page explains it:
|
||||
```
|
||||
Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is
|
||||
specified. A word is a non-zero-length sequence of characters delimited by white space. With no
|
||||
FILE, or when FILE is -, read standard input.
|
||||
```
|
||||
|
||||
The following Q&A-styled examples will give you an even better idea about the basic usage of wc.
|
||||
|
||||
Note: We'll be using a file named file.txt as the input file in all our examples. Following is what the file contains:
|
||||
```
|
||||
hi
|
||||
hello
|
||||
how are you
|
||||
thanks.
|
||||
```
|
||||
|
||||
### Q1. How to print the byte count
|
||||
|
||||
Use the **-c** command line option to print the byte count.
|
||||
|
||||
wc -c file.txt
|
||||
|
||||
Here's the output this command produced on our system:
|
||||
|
||||
[![How to print the byte count][1]][2]
|
||||
|
||||
So the file contains 29 bytes.
|
||||
|
||||
### Q2. How to print the character count
|
||||
|
||||
To print the number of characters, use the **-m** command line option.
|
||||
|
||||
wc -m file.txt
|
||||
|
||||
Here's the output this command produced on our system:
|
||||
|
||||
[![How to print the character count][3]][4]
|
||||
|
||||
So the file contains 29 characters.
|
||||
|
||||
### Q3. How to print the newline count
|
||||
|
||||
Use the **-l** command line option to print the number of newlines in the file.
|
||||
|
||||
wc -l file.txt
|
||||
|
||||
Here's the output in our case:
|
||||
|
||||
[![How to print the newline count][5]][6]
|
||||
|
||||
### Q4. How to print the word count
|
||||
|
||||
To print the number of words present in the file, use the **-w** command line option.
|
||||
|
||||
wc -w file.txt
|
||||
|
||||
Following the output the command produced in our case:
|
||||
|
||||
[![How to print the word count][7]][8]
|
||||
|
||||
So this reveals there are 6 words in the file.
|
||||
|
||||
### Q5. How to print the maximum display width or length of longest line
|
||||
|
||||
In case you want to print the length of the longest line in the input file, use the **-L** command line option.
|
||||
|
||||
wc -L file.txt
|
||||
|
||||
Here's the output the command produced in our case:
|
||||
|
||||
[![How to print the maximum display width or length of longest line][9]][10]
|
||||
|
||||
So the length of the longest file in our file is 11.
|
||||
|
||||
### Q6. How to read input file name(s) from a file
|
||||
|
||||
In case you have multiple file names, and you want wc to read them from a file, then use the **\--files0-from** option.
|
||||
|
||||
wc --files0-from=names.txt
|
||||
|
||||
[![How to read input file name\(s\) from a file][11]][12]
|
||||
|
||||
So you can see that the wc command, in this case, produced lines, words, and characters count for file.txt in the output. The name file.txt was mentioned in the names.txt file. It's worth mentioning that to successfully use this option, names written the file should be NUL terminated - you can generate this character by typing Ctrl+v followed by Ctrl+Shift+@.
|
||||
|
||||
### Conclusion
|
||||
|
||||
As you'd agree, wc is a simple command, both from understanding and usage purposes. We've covered pretty much all command line options the tool offers, so you should be ready to use the tool on a daily basis once you practice whatever we've explained here. For more info on wc, head to its [man page][13].
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/linux-wc-command-explained-for-beginners-6-examples/
|
||||
|
||||
作者:[Himanshu Arora][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.howtoforge.com
|
||||
[1]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-c-option.png
|
||||
[2]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-c-option.png
|
||||
[3]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-m-option.png
|
||||
[4]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-m-option.png
|
||||
[5]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-l-option.png
|
||||
[6]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-l-option.png
|
||||
[7]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-w-option.png
|
||||
[8]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-w-option.png
|
||||
[9]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-L-option.png
|
||||
[10]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-L-option.png
|
||||
[11]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-file0-from-option.png
|
||||
[12]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-file0-from-option.png
|
||||
[13]:https://linux.die.net/man/1/wc
|
@ -0,0 +1,64 @@
|
||||
|
||||
迁移到 Linux :入门介绍
|
||||
======
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/migrating-to-linux.jpg?itok=sjcGK0SY)
|
||||
运行 Linux 的计算机系统到遍布每个角落。Linux 运行我们的互联网服务,从谷歌搜索到“脸书” ```(Facebook)```,等等。Linux 也在很多设备上运行,包括我们的智能手机、电视,甚至汽车。当然,Linux 也可以运行在您的桌面系统上。如果您是 Linux 新手,或者您想在您的桌面计算机上尝试一些不同的东西,这篇文章将简要地介绍其基础知识,并帮助您从另一个系统迁移到 Linux。
|
||||
|
||||
切换到不同的操作系统可能是一个挑战,因为每个操作系统都提供了不同的操作方法。其在一个系统上的第二特性可能会阻碍其在另一个系统正常使用,因此我们需要到网上或书本上查找怎样操作。
|
||||
### Windows 与 Linux 的区别 ```来自于法语(万岁的区别)--来自于 wiktionary ```
|
||||
|
||||
要开始使用 Linux,您可能会注意到,Linux 的打包方式不同。在其他操作系统中,许多组件被捆绑在一起,只是包的一部分。然而,在 Linux 中,每个组件都被分别调用。举个例子来说,在 Windows 下,图形界面只是操作系统的一部分。而在 Linux 下,您可以从多个图形环境中进行选择,比如 GNOME、KDE Plasma、Cinnamon 和 MATE 等。
|
||||
At a high level, a Linux installation includes the following things:
|
||||
在高级别上,Linux安装包括以下内容:
|
||||
1. 内核
|
||||
2. 系统程序和文件驻留在磁盘上
|
||||
3. 图形环境
|
||||
4. 包管理器
|
||||
5. 应用程序
|
||||
|
||||
|
||||
|
||||
### 内核
|
||||
|
||||
操作系统的核心称为内核。内核是引擎罩下的引擎。它允许多个应用程序同时运行,并协调它们对公共服务和设备的访问,从而使所有设备运行顺畅。
|
||||
### 系统程序和文件(系统)
|
||||
|
||||
系统程序位于文件和目录的标准层次结构中的磁盘上。这些系统程序和文件包括后台运行的服务(称为守护进程)、各种操作的实用程序、配置文件和日志文件。
|
||||
|
||||
这些系统程序不是在内核中运行,而是执行基本系统操作的应用程序——例如,设置日期和时间,并在网络上连接,这样你就可以上网了。
|
||||
|
||||
这里包含了初始化(init)程序——最新运行应用程序。该程序负责启动所有后台服务(如WEB服务器)、启动网络链接和启动图形环境。这个初始化(init)程序将根据需要启动其他系统程序。
|
||||
|
||||
其他系统程序为简单的任务提供便利,比如添加用户和组、更改密码和配置磁盘。
|
||||
### 图形环境
|
||||
|
||||
图形环境实际上只是更多的系统程序和文件。图形环境提供了常用的菜单窗口、鼠标指针、对话框、状态和指示器等。
|
||||
需要注意的是,您不需要使用最初安装的图形环境。如果你愿意,你可以把它另外的形式。每个图形环境都有不同的特性。有些看起来更像 Apple OS X,有些看起来更像 Windows,有些则是独一无二的,不要试图模仿其他的图形界面。
|
||||
### 包管理器
|
||||
|
||||
包管理器在不同的系统中很难被我们把握,但是现在有一个人们非常熟悉的类似的系统——应用程序商店。软件包系统实际上是为 Linux 存储应用程序。您可以使用包管理器来选择您想要的应用程序,而不是从该web站点安装这个应用程序,以及从另一个站点来安装其他应用程序。然后,包管理器从预先构建的开放源码应用程序的中心知识库安装应用程序。
|
||||
### 应用程序
|
||||
|
||||
Linux附带了许多预安装的应用程序。您可以从包管理器获得更多。许多应用程序相当棒,其他人需要工作(?)。有时,同一个应用程序在 Windows 或 Mac OS 或 Linux 上运行的版本会不同。
|
||||
例如,您可以使用 Firefox 浏览器和 Thunderbird (用于电子邮件)。您可以使用 LibreOffice 作为 Microsoft Office 的替代品,并通过 Valve's Steam 程序运行游戏。您甚至可以在 Linux 上使用 WINE 来运行一些本地 Windows 应用程序。
|
||||
### 安装 Linux
|
||||
|
||||
第一步通常是安装Linux发行版。你可能听说过 Red Hat、Ubuntu、Fedora、Arch Linux 和 SUSE,等等。这些是 Linux 的不同发行版。
|
||||
如果没有 Linux 发行版,则必须分别安装每个组件。许多组件是由不同人群开发和提供的,因此单独安装每个组件将是一项冗长而乏味的任务。幸运的是,构建 ```distros``` 的人会为您做这项工作。他们抓取所有的组件,构建它们,确保它们一起工作,然后将它们打包在一个单独的安装进程中。
|
||||
各种发行版可能会做出不同的选择,使用不同的组件,但它仍然是 Linux。应用程序被开发在一个发行版中却经常在其他发行版上运行的很好。
|
||||
如果你是一个Linux初学者,想尝试Linux,我推荐[Ubuntu 安装][1]。还有其他的发行版也可以尝试: Linux Mint、Fedora、Debian、Zorin OS、Elementary OS等等。在以后的文章中,我们将介绍 Linux 系统的其他方面,并提供关于如何开始使用 Linux 的更多信息。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
|
||||
|
||||
作者:[John Bonesio][a]
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/johnbonesio
|
||||
[1]:https://www.ubuntu.com/download/desktop
|
||||
[2]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
Loading…
Reference in New Issue
Block a user