mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-25 00:50:15 +08:00
commit
9353f19af9
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: ( guevaraya)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -0,0 +1,175 @@
|
||||
MidnightBSD 可能是你通往 FreeBSD 的大门
|
||||
======
|
||||

|
||||
|
||||
[FreeBSD][1] 是一个开源操作系统,衍生自著名的 [Berkeley Software Distribution,伯克利软件套件][2]。FreeBSD 的第一个版本在 1993 年发布,并且仍然很强大。2007 年左右,Lucas Holt 想创建一个 FreeBSD 的分支,利用 OpenStep (现在是 Cocoa) 的 Objective-C 框架,widget 工具包和应用程序开发工具的 [GnuStep][3] 的实现。为此,他开始开发 MidnightBSD 桌面发行版。
|
||||
|
||||
MidnightBSD (以 Lucas 的猫命名,Midnight) 仍然在积极地(尽管缓慢)开发。自2017年8月可以获得最新的稳定发布版本 (0.8.6) 。尽管 BSD 发行版不是你所说的用户友好型发行版,通过命令行来加速它们的安装速度是一个你自己熟悉如何处理一个文本( ncurses )安装和最后完成安装的非常好的方法。
|
||||
|
||||
为此,你最终会得到一个非常可靠的 FreeBSD 分支的桌面发行版。但是如果你是一名 Linux 用户正在寻找扩展你的技能的方法,它将做一点工作,… 这是一个很好的起始地方。
|
||||
|
||||
我想带你走过安装 MidnightBSD 的工艺流程,如何添加一个图形桌面环境,然后如何安装应用程序。
|
||||
|
||||
### 安装
|
||||
|
||||
正如我所提到的,这是一个文本( ncurses ) 安装过程,因此在这里没有找到可用的鼠标。相反,你将使用你键盘的 Tab 和箭头按键。在你下载 [最新的发布版本][4] 后,将它刻录到一个 CD/DVD 或 USB 驱动器,并启动你的机器(或者在 [VirtualBox][5] 中创建一个虚拟机)。安装器将打开并给你三个选项(图 1)。选择安装(使用你的键盘的箭头按键),并敲击 Enter 键。
|
||||
|
||||
|
||||
![MidnightBSD installer][6]
|
||||
|
||||
图 1: 启动 MidnightBSD 安装器。
|
||||
|
||||
|
||||
在这点上,在这里要经历相当多的屏幕。其中很多屏幕是一目了然的:
|
||||
|
||||
1. 设置非默认键盘映射(是/否)
|
||||
|
||||
2. 设置主机名称
|
||||
|
||||
3. 添加可选系统组件(文档,游戏,32位兼容性,系统源码代码)
|
||||
|
||||
4. 分区硬盘
|
||||
|
||||
5. 管理员密码
|
||||
|
||||
6. 配置网络接口
|
||||
|
||||
7. 选择地区(时区)
|
||||
|
||||
8. 启用服务(例如获得 shell)
|
||||
|
||||
9. 添加用户(图 2)
|
||||
|
||||
|
||||
|
||||
|
||||
![Adding a user][7]
|
||||
|
||||
图 2: 向系统添加一个用户。
|
||||
|
||||
|
||||
在你向系统添加用户后,你将被拖拽到一个窗口中(图 3),在这里,你可以处理任何你可能忘记的或你想重新配置的东西。如果你不需要作出任何更改,选择 Exit ,然后你的配置将被应用。
|
||||
|
||||
![Applying your configurations][8]
|
||||
|
||||
图 3: 应用你的配置。
|
||||
|
||||
在接下来的窗口中,当出现提示时,选择 No ,接下来系统将重启。在 MidnightBSD 重启后,你已经为下一阶段的安装做好了准备。
|
||||
|
||||
### Post 安装
|
||||
|
||||
当你最新安装的 MidnightBSD 启动时,你将发现你自己在一个命令提示符中。在这一点上,在这里未找到图形界面。我安装应用程序,MidnightBSD 依赖于 mport 工具。比如说你想安装 Xfce 桌面环境。为此,登录到 MidnightBSD 中,并发出下面的命令:
|
||||
```
|
||||
sudo mport index
|
||||
|
||||
sudo mport install xorg
|
||||
|
||||
```
|
||||
|
||||
你现在有已经安装的 Xorg 窗口服务器,它将允许你来安装桌面环境。使用命令来安装 Xfce :
|
||||
```
|
||||
sudo mport install xfce
|
||||
|
||||
```
|
||||
|
||||
现在已经安装 Xfce 。不过,我们需要和命令 startx 一起运行来启用它。为此,让我们先安装 nano 编辑器。发出命令:
|
||||
```
|
||||
sudo mport install nano
|
||||
|
||||
```
|
||||
|
||||
随着 nano 已安装,发出命令:
|
||||
```
|
||||
nano ~/.xinitrc
|
||||
|
||||
```
|
||||
|
||||
这个文件仅包含一行:
|
||||
```
|
||||
exec startxfce4
|
||||
|
||||
```
|
||||
|
||||
保存并关闭这个文件。如果你现在发出命令 startx, Xfce 桌面环境将启动。你应该会感到一点在家里的感觉(图 4).
|
||||
|
||||
![ Xfce][9]
|
||||
|
||||
图 4: Xfce桌面界面已准备好服务。
|
||||
|
||||
因为你不想总是必需发出命令 startx ,你希望启用登录守护进程。然而,却没有安装。要安装这个子系统,发出命令:
|
||||
```
|
||||
sudo mport install mlogind
|
||||
|
||||
```
|
||||
|
||||
当完成安装后,通过在 /etc/rc.conf 文件中添加一个项目来在启动时启用 mlogind 。在 rc.conf 文件的底部,添加以下内容:
|
||||
```
|
||||
mlogind_enable=”YES”
|
||||
|
||||
```
|
||||
|
||||
保存并关闭该文件。现在,当你启动(或重启)机器时,你应该会看到图形登录屏幕。在写这篇文章的时候,在登录后,我最后得到一个空白屏幕和不想要的 X 光标。不幸的是,目前似乎并没有这个问题的解决方法。所以,要访问你的桌面环境,你必需使用 startx 命令。
|
||||
|
||||
### 安装
|
||||
|
||||
开箱即用,你将不能找到很多能使用的应用程序。如果你尝试安装应用程序(使用 mport ),你将很快发现你自己的沮丧,因为只能找到很少的应用程序。为解决这个问题,我们需要使用 svnlite 命令来查看检查出可用的 mport 软件列表。回到终端窗口,并发出命令:
|
||||
```
|
||||
svnlite co http://svn.midnightbsd.org/svn/mports/trunk mports
|
||||
|
||||
```
|
||||
|
||||
在你完成这些后,你应该看到一个命名为 ~/mports 的新的命令。 更改到这个目录(使用命令 cd ~/.mports 。发出 ls 命令,然后你应该看到许多的类别(图 5)。
|
||||
|
||||
![applications][10]
|
||||
|
||||
图 5: 对于 mport 现在可用的应用程序类别。
|
||||
|
||||
你想安装 Firefox ?如果你查看 www 目录,你将看到一个 linux-firefox 列表。发出命令:
|
||||
```
|
||||
sudo mport install linux-firefox
|
||||
|
||||
```
|
||||
|
||||
现在你应该会在 Xfce 桌面菜单中看到一个 Firefox 项目。翻找所有的类别,并使用 mport 命令来安装你需要的所有软件。
|
||||
|
||||
### 一个悲哀的警告
|
||||
|
||||
一个悲哀的小警告是, mport (通过via svnlite) 仅能找到的一个 office 套件的版本是 OpenOffice 3 。那是非常过时的。尽管 在 ~/mports/editors 目录中找到 Abiword ,但是它看起来不可用于安装。甚至在安装 OpenOffice 3 后,它会输出一个 Exec 格式错误。换句话说,你将不能使用 MidnightBSD 在 office 生产效率方面做很多的事情。但是,嘿嘿,如果你周围躺有一个旧的 Palm 导航器,你也安装 pilot 链接。换句话说,可用的软件不能生成一个极其有用的桌面发行版… 至少对普通用户不是。但是,如果你想在 MidnightBSD 上开发,你将找到很多可用的工具,准备安装(查看 ~/mports/devel 目录)。你甚至可以使用命令安装 Drupal :
|
||||
|
||||
```
|
||||
sudo mport install drupal7
|
||||
```
|
||||
|
||||
当然,在此之后,你将需要创建一个数据库( MySQL 已经安装),安装 Apache (sudo mport install apache24) ,并配置必需的 Apache 指令。
|
||||
|
||||
显然地,已安装的和能够安装什么是一个已经应用程序,系统和服务的大杂烩。但是随着足够多的工作,你最终可以得到一个能够服务特殊目的的发行版。
|
||||
|
||||
### 享受 *BSD 优良
|
||||
|
||||
这就是你如何使 MidnightBSD 启动,并在一个有点用的桌面发行版中运行。它不像很多其它的 Linux 发行版一样快速容易,但是如果你想要一个你想要的发行版,这可能正是你正在寻找的。尽管很多竞争对手有很多为安装而准备的可用的软件标题,MidnightBSD 无疑是一个 Linux 爱好者或管理员应该尝试的有趣的挑战。
|
||||
|
||||
通过来自 Linux 基金会和 edX 的免费的[" Linux 简介" ][11]课程学习更多关于 Linux 的信息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/intro-to-linux/2018/5/midnightbsd-could-be-your-gateway-freebsd
|
||||
|
||||
作者:[Jack Wallen][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/jlwallen
|
||||
[1]:https://www.freebsd.org/
|
||||
[2]:https://en.wikipedia.org/wiki/Berkeley_Software_Distribution
|
||||
[3]:https://en.wikipedia.org/wiki/GNUstep
|
||||
[4]:http://www.midnightbsd.org/download/
|
||||
[5]:https://www.virtualbox.org/
|
||||
[6]:https://lcom.static.linuxfound.org/sites/lcom/files/midnight_1.jpg (MidnightBSD installer)
|
||||
[7]:https://lcom.static.linuxfound.org/sites/lcom/files/midnight_2.jpg (Adding a user)
|
||||
[8]:https://lcom.static.linuxfound.org/sites/lcom/files/mightnight_3.jpg (Applying your configurations)
|
||||
[9]:https://lcom.static.linuxfound.org/sites/lcom/files/midnight_4.jpg (Xfce)
|
||||
[10]:https://lcom.static.linuxfound.org/sites/lcom/files/midnight_5.jpg (applications)
|
||||
[11]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
@ -7,43 +7,43 @@
|
||||
[#]: via: (https://www.2daygeek.com/linux-commands-check-memory-usage/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
8 Commands to Check Memory Usage on Linux
|
||||
检查 Linux 中内存使用情况的8条命令
|
||||
======
|
||||
|
||||
Linux is not like Windows and you will not get a GUI always, especially in a server environment.
|
||||
Linux 并不像 Windows,你经常不会有图形界面可供使用,特别是在服务器环境中。
|
||||
|
||||
As a Linux administrator, it is important to know how to check your available and used resources, such as memory, CPU, disk space, etc.
|
||||
作为一名 Linux 管理员,知道如何获取当前可用的和已经使用的资源情况,比如内存、CPU、磁盘等,是相当重要的。
|
||||
|
||||
If there are any applications that use too much resources on the system to run your system at the optimum level you need to find and fix.
|
||||
如果某一应用在你的系统上占用了太多的资源,导致你的系统无法达到最优状态,那么你需要找到并修正它。
|
||||
|
||||
If you want to **[find out the top 10 memory (RAM) consumption processes in Linux][1]**, go to the following article.
|
||||
如果你想找到消耗内存前十名的进程,你需要去阅读这篇文章: **[在 Linux 系统中找到消耗内存最多的 10 个进程][1]** 。
|
||||
|
||||
In Linux, there are commands for everything, so use the corresponding commands.
|
||||
在 Linux 中,命令能做任何事,所以使用相关命令吧。
|
||||
|
||||
In this tutorial, we will show you eight powerful commands to check memory usage on a Linux system, including RAM and swap.
|
||||
在这篇教程中,我们将会给你展示 8 个有用的命令来即查看在 Linux 系统中内存的使用情况,包括 RAM 和交换分区。
|
||||
|
||||
**[Creating swap space on a Linux system][2]** is very important.
|
||||
创建交换分区在 Linux 系统中是非常重要的,如果你想了解如何创建,可以去阅读这篇文章: **[在 Linux 系统上创建交换分区][2]** 。
|
||||
|
||||
The following commands can help you check memory usage in Linux in different ways.
|
||||
下面的命令可以帮助你以不同的方式查看 Linux 内存使用情况。
|
||||
|
||||
* free Command
|
||||
* /proc/meminfo File
|
||||
* vmstat Command
|
||||
* ps_mem Command
|
||||
* smem Command
|
||||
* top Command
|
||||
* htop Command
|
||||
* glances Command
|
||||
* free 命令
|
||||
* /proc/meminfo 文件
|
||||
* vmstat 命令
|
||||
* ps_mem 命令
|
||||
* smem 命令
|
||||
* top 命令
|
||||
* htop 命令
|
||||
* glances 命令
|
||||
|
||||
|
||||
|
||||
### 1) How to Check Memory Usage on Linux Using the free Command
|
||||
### 1)如何使用 free 命令查看 Linux 内存使用情况
|
||||
|
||||
**[Free command][3]** is the most powerful command widely used by the Linux administrator. But it provides very little information compared to the “/proc/meminfo” file.
|
||||
**[Free 命令][3]** 是被 Linux 管理员广泛使用地命令。但是它提供的信息比 “/proc/meminfo” 文件少。
|
||||
|
||||
Free command displays the total amount of free and used physical and swap memory on the system, as well as buffers and caches used by the kernel.
|
||||
Free 命令会分别展示物理内存和交换分区内存中已使用的和未使用的数量,以及内核使用的缓冲区和缓存。
|
||||
|
||||
These information is gathered from the “/proc/meminfo” file.
|
||||
这些信息都是从 “/proc/meminfo” 文件中获取的。
|
||||
|
||||
```
|
||||
# free -m
|
||||
@ -52,24 +52,24 @@ Mem: 15867 9199 1702 3315 4965 3039
|
||||
Swap: 17454 666 16788
|
||||
```
|
||||
|
||||
* **total:** Total installed memory
|
||||
* **used:** Memory is currently in use by running processes (used= total – free – buff/cache)
|
||||
* **free:** Unused memory (free= total – used – buff/cache)
|
||||
* **shared:** Memory shared between two or more processes (multiple processes)
|
||||
* **buffers:** Memory reserved by the kernel to hold a process queue request.
|
||||
* **cache:** Size of the page cache that holds recently used files in RAM
|
||||
* **buff/cache:** Buffers + Cache
|
||||
* **available:** Estimation of how much memory is available for starting new applications, without swapping.
|
||||
* **total:** 总的内存量
|
||||
* **used:** 当前正在被运行中的进程使用的内存量 (used = total – free – buff/cache)
|
||||
* **free:** 未被使用的内存量 (free = total – used – buff/cache)
|
||||
* **shared:** 在两个或多个进程之间共享的内存量 (多进程)
|
||||
* **buffers:** 内核用于记录进程队列请求的内存量
|
||||
* **cache:** 在 RAM 中最近使用的文件中的页缓冲大小
|
||||
* **buff/cache:** 缓冲区和缓存总的使用内存量
|
||||
* **available:** 启动新应用不含交换分区的可用内存量
|
||||
|
||||
|
||||
|
||||
### 2) How to Check Memory Usage on Linux Using the /proc/meminfo File
|
||||
### 2) 如何使用 /proc/meminfo 文件查看 Linux 内存使用情况
|
||||
|
||||
The “/proc/meminfo” file is a virtual file that contains various real-time information about memory usage.
|
||||
“/proc/meminfo” 文件是一个包含了多种内存使用的实时信息的虚拟文件。
|
||||
|
||||
It shows memory stats in kilobytes, most of which are somewhat difficult to understand.
|
||||
它展示内存状态单位使用的是 kB,其中大部分属性都难以理解。
|
||||
|
||||
However it contains useful information about memory usage.
|
||||
然而它也包含了内存使用情况的有用信息。
|
||||
|
||||
```
|
||||
# cat /proc/meminfo
|
||||
@ -124,13 +124,14 @@ DirectMap2M: 14493696 kB
|
||||
DirectMap1G: 2097152 kB
|
||||
```
|
||||
|
||||
### 3) How to Check Memory Usage on Linux Using the vmstat Command
|
||||
### 3) 如何使用 vmstat 命令查看 Linux 内存使用情况
|
||||
|
||||
The **[vmstat command][4]** is another useful tool for reporting virtual memory statistics.
|
||||
**[vmstat 命令][4]** 是另一个报告虚拟内存统计信息的有用工具。
|
||||
|
||||
vmstat reports information about processes, memory, paging, block IO, traps, disks, and cpu functionality.
|
||||
vmstat 报告的信息包括:进程、内存、页面映射、块 I/O、陷阱、磁盘和 cpu 功能信息。
|
||||
|
||||
vmstat does not require special permissions, and it can help identify system bottlenecks.
|
||||
|
||||
vmstat 不需要特殊的权限,并且它可以帮助诊断系统瓶颈。
|
||||
|
||||
```
|
||||
# vmstat
|
||||
@ -140,58 +141,58 @@ procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
|
||||
1 0 682060 1769324 234188 4853500 0 3 25 91 31 16 34 13 52 0 0
|
||||
```
|
||||
|
||||
If you want to understand this in detail, read the field description below.
|
||||
如果你想详细了解每一项的含义,阅读下面的描述。
|
||||
|
||||
**Procs**
|
||||
|
||||
* **r:** The number of runnable processes (running or waiting for run time).
|
||||
* **b:** The number of processes in uninterruptible sleep.
|
||||
* **r:** 可以运行的进程数目(正在运行或等待运行)
|
||||
* **b:** 不间断睡眠中的进程数目
|
||||
|
||||
|
||||
|
||||
**Memory**
|
||||
|
||||
* **swpd:** the amount of virtual memory used.
|
||||
* **free:** the amount of idle memory.
|
||||
* **buff:** the amount of memory used as buffers.
|
||||
* **cache:** the amount of memory used as cache.
|
||||
* **inact:** the amount of inactive memory. (-a option)
|
||||
* **active:** the amount of active memory. (-a option)
|
||||
|
||||
* **swpd:** 使用的虚拟内存数量
|
||||
* **free:** 空闲的内存数量
|
||||
* **buff:** 用作缓冲区内存的数量
|
||||
* **cache:** 用作缓存内存的数量
|
||||
* **inact:** 不活动的内存数量(-a 选项)
|
||||
* **active:** 活动的内存数量(-a 选项)
|
||||
|
||||
|
||||
|
||||
**Swap**
|
||||
|
||||
* **si:** Amount of memory swapped in from disk (/s).
|
||||
* **so:** Amount of memory swapped to disk (/s).
|
||||
* **si:** 从磁盘交换的内存数量 (/s).
|
||||
* **so:** 交换到磁盘的内存数量 (/s).
|
||||
|
||||
|
||||
|
||||
**IO**
|
||||
|
||||
* **bi:** Blocks received from a block device (blocks/s).
|
||||
* **bo:** Blocks sent to a block device (blocks/s).
|
||||
* **bi:** 从一个块设备中收到的块 (blocks/s).
|
||||
* **bo:** 发送到一个块设备的块 (blocks/s).
|
||||
|
||||
|
||||
|
||||
**System**
|
||||
|
||||
* **in:** The number of interrupts per second, including the clock.
|
||||
* **cs:** The number of context switches per second.
|
||||
* **in:** 每秒的中断此数,包括时钟。
|
||||
* **cs:** 每秒的上下文切换次数。
|
||||
|
||||
|
||||
|
||||
**CPU : These are percentages of total CPU time.**
|
||||
**CPU : 下面这些是在总的 CPU 时间占的百分比 **
|
||||
|
||||
* **us:** Time spent running non-kernel code. (user time, including nice time)
|
||||
* **sy:** Time spent running kernel code. (system time)
|
||||
* **id:** Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
|
||||
* **wa:** Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
|
||||
* **st:** Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.
|
||||
* **us:** 花费在非内核上的时间占比(包括用户时间,调度)
|
||||
* **sy:** 花费在内核上的时间占比 (系统时间)
|
||||
* **id:** 花费在闲置的时间占比。在 Linux 2.5.41 之前,包括 I/O 等待时间
|
||||
* **wa:** 花费在 I/O 等待上的时间占比。在 Linux 2.5.41 之前,包括空闲时间
|
||||
* **st:** 被虚拟机偷走的时间占比。在 Linux 2.6.11 之前,这部分称为 unknow
|
||||
|
||||
|
||||
|
||||
Run the following command for detailed information.
|
||||
运行下面的命令查看详细的信息。
|
||||
|
||||
```
|
||||
# vmstat -s
|
||||
@ -223,16 +224,15 @@ Run the following command for detailed information.
|
||||
1577163147 boot time
|
||||
3318 forks
|
||||
```
|
||||
### 4) 如何使用 ps_mem 命令查看 Linux 内存使用情况
|
||||
|
||||
### 4) How to Check Memory Usage on Linux Using the ps_mem Command
|
||||
**[ps_mem][5]** 是一个简单的 Python 脚本用来查看当前内存使用情况。
|
||||
|
||||
**[ps_mem][5]** is a simple Python script that allows you to get core memory usage accurately for a program in Linux.
|
||||
该工具可以确定每个程序使用了多少内存(不是每个进程)。
|
||||
|
||||
This can determine how much RAM is used per program (not per process).
|
||||
该工具采用如下的方法计算每个程序使用内存:总的使用 = 程序进程私有的内存 + 程序进程共享的内存。
|
||||
|
||||
It calculates the total amount of memory used per program, total = sum (private RAM for program processes) + sum (shared RAM for program processes).
|
||||
|
||||
The shared RAM is problematic to calculate, and the tool automatically selects the most accurate method available for the running kernel.
|
||||
计算共享内存是存在不足之处的,该工具可以为运行中的内核自动选择最准确的方法。
|
||||
|
||||
```
|
||||
# ps_mem
|
||||
@ -285,15 +285,15 @@ The shared RAM is problematic to calculate, and the tool automatically selects t
|
||||
==================================
|
||||
```
|
||||
|
||||
### 5) How to Check Memory Usage on Linux Using the smem Command
|
||||
### 5)如何使用 smem 命令查看 Linux 内存使用情况
|
||||
|
||||
**[smem][6]** is a tool that can provide numerous reports of memory usage on Linux systems. Unlike existing tools, smem can report Proportional Set Size (PSS), Unique Set Size (USS) and Resident Set Size (RSS).
|
||||
**[smem][6]** 是一个可以为 Linux 系统提供多种内存使用情况报告的工具。不同于现有的工具,smem 可以报告比例集大小(PSS)、唯一集大小(USS)和居住集大小(RSS)
|
||||
|
||||
Proportional Set Size (PSS): refers to the amount of memory used by libraries and applications in the virtual memory system.
|
||||
比例集(PSS):库和应用在虚拟内存系统中的使用量。
|
||||
|
||||
Unique Set Size (USS) : Unshared memory is reported as USS (Unique Set Size).
|
||||
唯一集大小(USS):其报告的是非共享内存。
|
||||
|
||||
Resident Set Size (RSS) : The standard measure of physical memory (it typically shared among multiple applications) usage known as resident set size (RSS) will significantly overestimate memory usage.
|
||||
居住集大小(RSS):物理内存(通常多进程共享)使用情况,其通常高于内存使用量。
|
||||
|
||||
```
|
||||
# smem -tk
|
||||
@ -336,13 +336,13 @@ Resident Set Size (RSS) : The standard measure of physical memory (it typically
|
||||
90 1 0 4.8G 5.2G 8.0G
|
||||
```
|
||||
|
||||
### 6) How to Check Memory Usage on Linux Using the top Command
|
||||
### 6) 如何使用 top 命令查看 Linux 内存使用情况
|
||||
|
||||
**[top command][7]** is one of the most frequently used commands by Linux administrators to understand and view the resource usage for a process on a Linux system.
|
||||
**[top 命令][7]** 是一个 Linux 系统的管理员最常使用的用于查看进程的资源使用情况的命令。
|
||||
|
||||
It displays the total memory of the system, current memory usage, free memory and total memory used by the buffers.
|
||||
该命令会展示了系统总的内存量,当前内存使用量,空闲内存量和缓冲区使用的内存总量。
|
||||
|
||||
In addition, it displays total swap memory, current swap usage, free swap memory, and total cached memory by the system.
|
||||
此外,该命令还会展示总的交换空间内存量,当前交换空间的内存使用量,空闲的交换空间内存量和缓存使用的内存总量。
|
||||
|
||||
```
|
||||
# top -b | head -10
|
||||
@ -368,25 +368,25 @@ KiB Swap: 17873388 total, 17873388 free, 0 used. 9179772 avail Mem
|
||||
2174 daygeek 20 2466680 122196 78604 S 0.8 0.8 0:17.75 WebExtensi+
|
||||
```
|
||||
|
||||
### 7) How to Check Memory Usage on Linux Using the htop Command
|
||||
### 7) 如何使用 htop 命令查看 Linux 内存使用情况
|
||||
|
||||
The **[htop command][8]** is an interactive process viewer for Linux/Unix systems. It is a text-mode application and requires the ncurses library, it was developed by Hisham.
|
||||
**[htop 命令][8]** 是一个可交互的 Linux/Unix 系统进程查看器。它是一个文本模式应用,且使用它需要 Hisham 开发的 ncurses库。
|
||||
|
||||
It is designed as an alternative to the top command.
|
||||
该名令的设计目的使用来代替 top 命令。
|
||||
|
||||
This is similar to the top command, but allows you to scroll vertically and horizontally to see all the processes running the system.
|
||||
该命令与 top 命令很相似,但是其允许你可以垂直地或者水平地的滚动以便可以查看系统中所有的进程情况。
|
||||
|
||||
htop comes with Visual Colors, which have added benefits and are very evident when it comes to tracking system performance.
|
||||
htop 命令拥有不同的颜色,这个额外的优点当你在追踪系统性能情况时十分有用。
|
||||
|
||||
You are free to carry out any tasks related to processes, such as process killing and renicing without entering their PIDs.
|
||||
此外,你可以自由地执行与进程相关的任务,比如杀死进程或者改变进程的优先级而不需要其进程号(PID)。
|
||||
|
||||
[![][9]][10]
|
||||
|
||||
### 8) How to Check Memory Usage on Linux Using the glances Command
|
||||
### 8)如何使用 glances 命令查看 Linux 内存使用情况
|
||||
|
||||
**[Glances][11]** is a cross-platform system monitoring tool written in Python.
|
||||
**[Glances][11]** 是一个 Python 编写的跨平台的系统监视工具。
|
||||
|
||||
You can see all information in one place such as CPU usage, Memory usage, running process, Network interface, Disk I/O, Raid, Sensors, Filesystem info, Docker, System info, Uptime, etc,.
|
||||
你可以在一个其中查看所有信息,比如:CPU使用情况,内存使用情况,正在运行的进程,网络接口,磁盘 I/O,RAID,传感器,文件系统信息,Docker,系统信息,运行时间等等。
|
||||
|
||||
![][9]
|
||||
|
Loading…
Reference in New Issue
Block a user