mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
Merge pull request #11656 from ScarboroughCoral/patch-1
Translated:20180419 Migrating to Linux- Network and System Settings.md
This commit is contained in:
commit
99f72b6b5f
@ -1,118 +0,0 @@
|
||||
ScarboroughCoral translating!
|
||||
|
||||
Migrating to Linux: Network and System Settings
|
||||
======
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO)
|
||||
In this series, we provide an overview of fundamentals to help you successfully make the transition to Linux from another operating system. If you missed the earlier articles in the series, you can find them here:
|
||||
|
||||
[Part 1 - An Introduction][1]
|
||||
|
||||
[Part 2 - Disks, Files, and Filesystems][2]
|
||||
|
||||
[Part 3 - Graphical Environments][3]
|
||||
|
||||
[Part 4 - The Command Line][4]
|
||||
|
||||
[Part 5 - Using sudo][5]
|
||||
|
||||
[Part 6 - Installing Software][6]
|
||||
|
||||
Linux gives you a lot of control over network and system settings. On your desktop, Linux lets you tweak just about anything on the system. Most of these settings are exposed in plain text files under the /etc directory. Here I describe some of the most common settings you’ll use on your desktop Linux system.
|
||||
|
||||
A lot of settings can be found in the Settings program, and the available options will vary by Linux distribution. Usually, you can change the background, tweak sound volume, connect to printers, set up displays, and more. While I won't talk about all of the settings here, you can certainly explore what's in there.
|
||||
|
||||
### Connect to the Internet
|
||||
|
||||
Connecting to the Internet in Linux is often fairly straightforward. If you are wired through an Ethernet cable, Linux will usually get an IP address and connect automatically when the cable is plugged in or at startup if the cable is already connected.
|
||||
|
||||
If you are using wireless, in most distributions there is a menu, either in the indicator panel or in settings (depending on your distribution), where you can select the SSID for your wireless network. If the network is password protected, it will usually prompt you for the password. Afterward, it connects, and the process is fairly smooth.
|
||||
|
||||
You can adjust network settings in the graphical environment by going into settings. Sometimes this is called System Settings or just Settings. Often you can easily spot the settings program because its icon is a gear or a picture of tools (Figure 1).
|
||||
|
||||
|
||||
![Network Settings][8]
|
||||
|
||||
Figure 1: Gnome Desktop Network Settings Indicator Icon.
|
||||
|
||||
[Used with permission][9]
|
||||
|
||||
### Network Interface Names
|
||||
|
||||
Under Linux, network devices have names. Historically, these are given names like eth0 and wlan0 -- or Ethernet and wireless, respectively. Newer Linux systems have been using different names that appear more esoteric, like enp4s0 and wlp5s0. If the name starts with en, it's a wired Ethernet interface. If it starts with wl, it's a wireless interface. The rest of the letters and numbers reflect how the device is connected to hardware.
|
||||
|
||||
### Network Management from the Command Line
|
||||
|
||||
If you want more control over your network settings, or if you are managing network connections without a graphical desktop, you can also manage the network from the command line.
|
||||
|
||||
Note that the most common service used to manage networks in a graphical desktop is the Network Manager, and Network Manager will often override setting changes made on the command line. If you are using the Network Manager, it's best to change your settings in its interface so it doesn't undo the changes you make from the command line or someplace else.
|
||||
|
||||
Changing settings in the graphical environment is very likely to be interacting with the Network Manager, and you can also change Network Manager settings from the command line using the tool called nmtui. The nmtui tool provides all the settings that you find in the graphical environment but gives it in a text-based semi-graphical interface that works on the command line (Figure 2).
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ)
|
||||
|
||||
On the command line, there is an older tool called ifconfig to manage networks and a newer one called ip. On some distributions, ifconfig is considered to be deprecated and is not even installed by default. On other distributions, ifconfig is still in use.
|
||||
|
||||
Here are some commands that will allow you to display and change network settings:
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ)
|
||||
|
||||
### Process and System Information
|
||||
|
||||
In Windows, you can go into the Task Manager to see a list of the all the programs and services that are running. You can also stop programs from running. And you can view system performance in some of the tabs displayed there.
|
||||
|
||||
You can do similar things in Linux both from the command line and from graphical tools. In Linux, there are a few graphical tools available depending on your distribution. The most common ones are System Monitor or KSysGuard. In these tools, you can see system performance, see a list of processes, and even kill processes (Figure 3).
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA)
|
||||
|
||||
In these tools, you can also view global network traffic on your system (Figure 4).
|
||||
|
||||
|
||||
![System Monitor][11]
|
||||
|
||||
Figure 4: Screenshot of Gnome System Monitor.
|
||||
|
||||
[Used with permission][9]
|
||||
|
||||
### Managing Process and System Usage
|
||||
|
||||
There are also quite a few tools you can use from the command line. The command ps can be used to list processes on your system. By default, it will list processes running in your current terminal session. But you can list other processes by giving it various command line options. You can get more help on ps with the commands info ps, or man ps.
|
||||
|
||||
Most folks though want to get a list of processes because they would like to stop the one that is using up too much memory or CPU time. In this case, there are two commands that make this task much easier. These are top and htop (Figure 5).
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl)
|
||||
|
||||
The top and htop tools work very similarly to each other. These commands update their list every second or two and re-sort the list so that the task using the most CPU is at the top. You can also change the sorting to sort by other resources as well such as memory usage.
|
||||
|
||||
In either of these programs (top and htop), you can type '?' to get help, and 'q' to quit. With top, you can press 'k' to kill a process and then type in the unique PID number for the process to kill it.
|
||||
|
||||
With htop, you can highlight a task by pressing down arrow or up arrow to move the highlight bar, and then press F9 to kill the task followed by Enter to confirm.
|
||||
|
||||
The information and tools provided in this series will help you get started with Linux. With a little time and patience, you'll feel right at home.
|
||||
|
||||
Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings
|
||||
|
||||
作者:[John Bonesio][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者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.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
|
||||
[2]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
|
||||
[3]:https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
|
||||
[4]:https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
|
||||
[5]:https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
|
||||
[6]:https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
|
||||
[7]:https://www.linux.com/files/images/figure-1png-2
|
||||
[8]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 (Network Settings)
|
||||
[9]:https://www.linux.com/licenses/category/used-permission
|
||||
[10]:https://www.linux.com/files/images/figure-4png-1
|
||||
[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF (System Monitor)
|
||||
[12]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
@ -0,0 +1,128 @@
|
||||
# 迁移到 Linux 工作环境: 网络和系统设置
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO)
|
||||
|
||||
在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问:
|
||||
|
||||
[Part 1 - 基本介绍][1]
|
||||
|
||||
[Part 2 - 磁盘、文件和文件系统][2]
|
||||
|
||||
[Part 3 - 图形界面环境][3]
|
||||
|
||||
[Part 4 - 命令行][4]
|
||||
|
||||
[Part 5 - 使用 sudo 命令][5]
|
||||
|
||||
[Part 6 - 软件安装][6]
|
||||
|
||||
Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。
|
||||
|
||||
|
||||
|
||||
大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。
|
||||
|
||||
|
||||
|
||||
### 连接因特网
|
||||
|
||||
在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。
|
||||
|
||||
如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。
|
||||
|
||||
在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。
|
||||
|
||||
![Network Settings][8]
|
||||
|
||||
图1: Gnome 桌面网络设置指示器图标.
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
### 网络接口名称
|
||||
|
||||
在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。
|
||||
|
||||
### 通过命令行进行网络管理
|
||||
|
||||
如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。
|
||||
|
||||
请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。
|
||||
|
||||
更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ)
|
||||
|
||||
图 2:nmtui 界面
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。
|
||||
|
||||
以下是一些允许您显示和更改网络设置的命令:
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ)
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
### 进程和系统信息
|
||||
|
||||
在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。
|
||||
|
||||
在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA)
|
||||
|
||||
图 3:NetHogs 截图
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
在这些工具中,你也可以查看系统全局网络流量(图 4)。
|
||||
|
||||
![System Monitor][11]
|
||||
|
||||
图4: Gnome System Monitor 的截图
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
### 管理进程和系统使用
|
||||
|
||||
您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。
|
||||
|
||||
大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl)
|
||||
|
||||
top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。
|
||||
|
||||
使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。
|
||||
|
||||
使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。
|
||||
|
||||
本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。
|
||||
|
||||
想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx.
|
||||
|
||||
------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings
|
||||
|
||||
作者:[John Bonesio][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[ScarboroughCoral](https://github.com/ScarboroughCoral)
|
||||
校对:[校对者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.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
|
||||
[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
|
||||
[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
|
||||
[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
|
||||
[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
|
||||
[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
|
||||
[7]: https://www.linux.com/files/images/figure-1png-2
|
||||
[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings"
|
||||
[9]: https://www.linux.com/licenses/category/used-permission
|
||||
[10]: https://www.linux.com/files/images/figure-4png-1
|
||||
[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor"
|
||||
[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
Loading…
Reference in New Issue
Block a user