This commit is contained in:
crowner 2013-12-02 19:56:12 +08:00
commit 1a5c2ea559
9 changed files with 363 additions and 358 deletions

View File

@ -1,3 +1,5 @@
translated by coolpigs
Basic Linux Interview Questions and Answers Part II
================================================================================
Continuing the Interview Series, we are giving 10 Questions here, in this article. These questions and the questions in the future articles doesnt necessarily means they were asked in any interview. We are presenting you an interactive learning platform through these kind of posts, which surely will be helpful.

View File

@ -1,34 +0,0 @@
【chenguang】翻译中》》》》》》》》》》》................
=
Daily Ubuntu TipsMake The Mouse Left-handed For Left Hand Users
================================================================================
The computer mouse was designed to be operated mostly using your index finger (the finger next to your thumb). By default, the mouse is configured for right-handed users. When you turn on your machine the first time, in most cases you will have to use your right index finger to click on things.
In fact, most left-handed users use the mouse to the left side of the keyboard and use their middle finger to click on things. This is not the best way for left handed users to use the mouse.
This brief tutorial is going those who need to use the mouse using their left hand properly. It will show left handed users how to setup the mouse so that the most commonly used button is operated using the left index finger.
This can also applied to right handed users. If the mouse is configured to be used using the left index finger, right handed users may use this guide to change the button from left to right.
To get started, click the gear button at the top right panel and select **System Settings**
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/mouse-left-handed.png)
Then select **Mouse & Touchpad** group from System Settings.. When it opens, choose **Right** to switch the commonly used click button to suite left handed users.
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/mouse-left-handed-1.png)
Switch back to Left to suite right handed users. The change will immediately take effect after selecting your choice.
That it. Now left handed users can move the mouse to the left of the keyboard and use their index finger on the left hand to operate the mouse properly.
Enjoy!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/11/daily-ubuntu-tipsmake-the-mouse-left-handed-for-left-hand-users/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,3 +1,5 @@
l3b2w1 translating……
Linux chief: Open source is safer, and Linux is more secure than any other OS
================================================================================
In an interview with Linux Foundation executive director Jim Zemlin, VentureBeat got a birds-eye view of the future of the open-source operating system for 2014.

View File

@ -1,3 +1,4 @@
[this is bazz2, if you wanna translate this article, no way :P]
This new worm targets Linux PCs and embedded devices
================================================================================
**The malware spreads by exploiting a 2012 vulnerability in PHP, Symantec researchers said**
@ -36,4 +37,4 @@ via: http://www.computerworld.com/s/article/9244409/This_new_worm_targets_Linux_
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.symantec.com/connect/blogs/linux-worm-targeting-hidden-devices
[1]:http://www.symantec.com/connect/blogs/linux-worm-targeting-hidden-devices

View File

@ -1,290 +0,0 @@
Unbelievable ! 30 Linux TOP Command Examples With Screenshots
================================================================================
The top command in Linux displays the running processes on the system. One of the most important tools for a system administrator. It is used extensively for monitoring the load on a server. In this article, we explore the top command in detail. The top command is an interactive command. Many commands are available when top is running. We will explore these commands as well.
### 1. Top Command output: ###
First of all, let us understand what the output says. Top command displays a lot of information about the running system. But we need to under stand the meaning of different sections of this output:
Running by default, the top command displays output like this:
![Top default display](http://linoxide.com/wp-content/uploads/2013/11/01.top_default.png)
First few lines are horizontal showing summary about different system parameters, and following these are the processes and their attributes in columns.
#### 1.1 Uptime and Load Averages: ####
![Uptime display](http://linoxide.com/wp-content/uploads/2013/11/02.top_uptime.png)
At the top of top command is displayed the output similar to uptime command.
The fields display:
- current time
- the time your system is been up
- number of users logged in
- load average of 5, 10 and 15 minutes respectively.
This uptime display can be toggled with l command.
#### 1.2 Tasks: ####
![Task summary](http://linoxide.com/wp-content/uploads/2013/11/03.top_tasks.png)
The second line shows summary of tasks or processes. The processes can be in different states. It shows total number of the processes. Out of these, the processes can be running, sleeping, stopped or in zombie (zombie is the state of a process state, These process summary can be toggled with t command.
#### 1.3 CPU States: ####
![CPU status display](http://linoxide.com/wp-content/uploads/2013/11/04.top_cpu_states.png)
Next is shown the CPU state. Here, %age of CPU time in different modes is shown. The meaning of different CPU times are:
- us, user: CPU time in running (un-niced) user processes
- sy, system: CPU time in running kernel processes
- ni, niced: CPU time in running niced user processes
- wa, IO wait: CPU time waiting for IO completion
- hi: CPU time serving hardware interrupts
- si: CPU time serving software interrupts
- st: CPU time stolen for this vm by the hipervisor.
This can be toggled with t command.
#### 1.4 Memory Usage: ####
![Memory usage](http://linoxide.com/wp-content/uploads/2013/11/05.top_mem_usage.png)
Next two lines show memory usage, somewhat like free command. 1st of these lines is for physical memory and the second for virtual memory (swap space).
The physical memory is displayed as: total available memory, used memory, free memory, and memory used for buffers
Similarly, swap reflects: total, used, free and cached swap space.
The memory can be toggled with m command.
#### 1.5 Fields/Columns: ####
![Top columns](http://linoxide.com/wp-content/uploads/2013/11/06.top_fields.png)
After these horizontal system properties and states, the processes are shown in columns. The different columns represent different properties discussed below.
By default, top shows these attributes associated with processes:
**PID**
The Process ID, to uniquely identify a processes.
**USER**
The effective user name of the owner of the processes.
**PR**
The scheduling priority of the process. Some values in this field are rt. It means that the process is running under real-time.
**NI**
The nice value of the process. Lower values mean higher priority.
**VIRT**
The amount of virtual memory used by the process.
**RES**
The resident memory size. Resident memory is the amount of non-swapped physical memory a task is using.
**SHR**
SHR is the shared memory used by the process.
**S**
This is the process status. It can have one of the following values:
- D uninterruptible sleep
- R running
- S sleeping
- T traced or stopped
- Z zombie
**%CPU**
It is the percentage of CPU time the task has used since last update.
**%MEM**
Percentage of available physical memory used by the process.
**TIME+**
The total CPU time the task has used since it started, with precision upto hundredth of a second.
**COMMAND**
The command which was used to start the process.
There are many other outputs which are not displayed by default which can display information about page faults, effective group and group ID of the process, and many more.
### 2. Interactive Commands: ###
We discussed earlier that the top command is interactive commands. Some of the commands we encountered in the last section. Here we explore these commands further.
#### 2.1 h: Help ####
First of all, you can press h or ? to display the help menu for interactive commands.
![Help options](http://linoxide.com/wp-content/uploads/2013/11/07.top_help.png)
#### 2.2 <ENTER> or <SPACE>: Refresh Display ####
The top command by default refreshes after a certain interval (3 seconds). To refresh manually, user can press enter or space key.
#### 2.3 A: Toggle Alternate Display Mode ####
This command switches between full-screen Mode and alternate-display mode. In alternate display mode, 4 windows are available:
1. Def
2. Job
3. Mem
4. Usr
Each of the 4 field groups has a unique separately configurable summary area and its own configurable task area. Only one of these 4 windows will be the current window. The current window is displayed on the top left corner.
![Alternative display mode](http://linoxide.com/wp-content/uploads/2013/11/08.top_alternative_display.png)
You can switch between 4 windows with a and w keys. a moves to next and w to previous window. With g command, you can enter a number to select the current window.
![Window selection in alternative display](http://linoxide.com/wp-content/uploads/2013/11/09.top_alternate_window_selection.png)
#### 2.4 B: Toggle Bold Display ####
Some important information is shown in bold characters. This command toggles use of bold.
![Bold off](http://linoxide.com/wp-content/uploads/2013/11/10.top_bold_display_off.png)
#### 2.5 d or s: Set Display Time interval ####
When d or s is pressed, you will be prompted to enter a value ( in seconds ) which will be set as display interval. If you enter 1 here, top will refresh every second.
![Display time interval](http://linoxide.com/wp-content/uploads/2013/11/11.top_display_time_interval.png)
#### 2.6 l, t, m: Toggle Load, Task, Memory Info ####
These will toggle load average, task/cpu status and mem info respectively as discussed.
![Load average off](http://linoxide.com/wp-content/uploads/2013/11/12.top_load_average_display_off.png)
![CPU summary off](http://linoxide.com/wp-content/uploads/2013/11/13.top_cpu_display_off.png)
![Memory and swap usage off](http://linoxide.com/wp-content/uploads/2013/11/14.top_mem_display_off.png)
![All three displays off](http://linoxide.com/wp-content/uploads/2013/11/15.top_all_three_display_off.png)
#### 2.7 f: Field Management ####
This is used to chose what field you want to display on the output screen. The fields marked as * are selected.
![Managing columns](http://linoxide.com/wp-content/uploads/2013/11/16.top_field_management.png)
< and >
The < command moves the sorted field to the left and > to the right
#### 2.8 R: Reverse Sort ####
Toggle Reverse/Normal sort order
#### 2.9 c: Toggle Command ####
Toggle full path of command that started the process and program name.
![Full command path](http://linoxide.com/wp-content/uploads/2013/11/17.top_command_name_displayed.png)
#### 2.10 i: Idle Tasks ####
Toggle idle tasks.
![Idle task display off](http://linoxide.com/wp-content/uploads/2013/11/18.top_idle_tasks_off.png)
#### 2.11 V: Forest View ####
Toggle forest view mode.
![Forest view of tasks](http://linoxide.com/wp-content/uploads/2013/11/19.top_forest_view.png)
#### 2.12 Z: Change color map ####
Pressing the Z key takes the user to a screen where the display color can be changed for top command. There are 8 task areas to chose from and 8 colors.
![Customizing colors](http://linoxide.com/wp-content/uploads/2013/11/20.top_color_selection.png)
The below screen shows full colored top view with all 4 screens on.
![Colored display](http://linoxide.com/wp-content/uploads/2013/11/21.top_colored.png)
#### 2.13 z: Toggle Color ####
Toggle color, i.e. turn on or off the colored display.
#### 2.14 x or y ####
Toggle highlights: x sort field; y running tasks. Depending upon your display settings, You might have to make the output colored in order to notice these highlights.
![X and Y highlighted](http://linoxide.com/wp-content/uploads/2013/11/22.top_x_y_displayed.png)
#### 2.15 u: Processes of a User ####
Show processes for a particular user. You are prompted to enter the username. Blank will show for all users.
![Processes of 'raghu' user](http://linoxide.com/wp-content/uploads/2013/11/23.top_raghu_processes.png)
#### 2.16 n or #: Number of tasks ####
Set maximum number of tasks displayed.
![Setting number of tasks displayed](http://linoxide.com/wp-content/uploads/2013/11/24.top_10_processes.png)
#### 2.17 k: Kill tasks ####
One of the most important commands of top. Used to send signals to tasks (Usually kill tasks).
![Killing a task](http://linoxide.com/wp-content/uploads/2013/11/25.top_kill_task.png)
#### 2.18 r: Renice ####
Renice a task to change the scheduling priority.
### 3. Command line options: ###
Most of these command line options are similar to the commands discussed above. Top output can be manipulated interactively with commands. But you can start top with some parameters set to your convenience with these options.
#### 3.1 -b: Batch mode ####
The -b option starts top command in batch mode. It can be useful when you want to save the output in a file.
#### 3.2 -c: Command/Program-name toggle: ####
As discussed in the above commands, this option will toggle from the last remembered state of command/program name display.
#### 3.3 -d: Set delay interval ####
Set the delay interval for top (in seconds). For example:
$ top -d 1
will start the top command with 1 sec delay interval.
#### 3.4 -i: idle process toggle ####
This option sets the top command with last remembered i state reversed.
#### 3.5 -n: Set number of iterations ####
With -n option, you can set the number of iterations after which top willl end.
$ top -n 3
will exit top automatically after 3 outputs.
#### 3.6 -p: monitor specific PIDs ####
You can specify what PIDs you want to monitor with -p option. PID value 0 will be treated as process ID of top command itself.
#### 3.7 -u or -U: username or UID ####
The process of a particular user can be viewed with these options. Username or UID can be specified to the option. The -p, -u and -U options are mutually exclusive. Only one of the options can be used at a time. You get error when you try to use any combination of these options:
$ top -p 28453 -u raghu
top: conflicting process selections (U/p/u)
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-command/linux-top-command-examples-screenshots/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -2,19 +2,19 @@
===
对于那些既有Windows电脑又有Ubuntu电脑但却只有一台打印机的用户这篇博文向你展示如何在Windows中共享一个打印机并允许Ubuntu使用它来打印。
几乎所有的打印机都默认支持Windows。许多打印机生产商都为Windows生产打印机但是很多却并不为Linux系统生产包括Ubuntu。所以假如你有一台支持Windows的打印机你可以在Windows机器上分享它然后让其它系统来使用它来打印。
几乎所有的打印机都默认支持Windows系统。许多打印机生产商都为Windows生产打印机但为Linux系统生产的并不多包括Ubuntu。所以假如你有一台支持Windows的打印机你可以在Windows机器上分享它然后让其它系统来使用它来打印。
在几年之前我遇到了这个问题那时大多数打印机生产商不支持Linux系统。我有一台老式的只支持Windows和Mac OS X但却不支持Linux的打印机。
我在我的Windows机器上安装了打印机驱动然后它就可以很好的工作咯。我的Windows机器使用它来打印非常好但是我的Ubuntu却无法使用它来打印因为打印机并不支持LAN。
所以我在Windows上共享该打印机然后我的Ubuntu机器就可以使用合适的字体和风格进行打印咯。假如你也遇到类似的情景你可以按照下面的指导也这样做
所以我在Windows上共享该打印机然后我的Ubuntu机器就可以使用合适的字体和风格进行打印咯。假如你也遇到类似的情景你可以按照下面的指导来操作
首先登入Windows右击你要共享的打印机然后点击**打印机属性**
首先登入Windows右击你要共享的打印机然后点击**Printer properties打印机属性**
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/printersharingubuntu.png)
接着,选择“分享”标签页,勾选上‘分享这台打印机’复选框来分享这台打印机。记住共享打印机的名字,因为你要使用这个共享名来连接这台打印机。
接着,选择“**Sharing共享**”标签页,勾选‘**Share this printer共享这台打印机**’复选框来共享。记住共享打印机的名字,因为你要使用这个共享名来连接这台打印机。
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/printersharingubuntu1.png)
@ -22,28 +22,28 @@
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
接着登入Ubuntu中选择顶部面板右边的**齿轮**,然后选择**设置...**
接着登入Ubuntu中选择顶部面板右边的**齿轮**,然后选择**系统设置...**
系统设置打开后,选择打印机,然后点击**添加**。当跳出来一个窗口让你选择设备时选择使用SAMBA的Windows打印机
系统设置打开后,选择打印机,然后点击**添加**。当跳出来一个窗口让你选择设备时,选择‘**Windows Printer via SAMBA使用SAMBA的Windows打印机**’。
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/printersharingubuntu2.png)
键入Windows电脑的IP地址或者主机名后面接着键入共享的打印机名。你可能需要键入你的windows验证信息用户名和密码验证后你就可以看到打印机咯,当你完成这些后,就可以点击向前继续下一步咯
键入Windows电脑的IP地址或者主机名后面接着键入共享的打印机名。你可能需要键入你的windows验证信息用户名和密码点击浏览来验证你是否可以看到打印机,当你完成这些后,就可以点击下一步继续
接着,选择打印机商标和模型。假如你在列表中看不到和你的打印机相似的模型,选择一个最接近它的然后继续。
接着,选择打印机品牌和型号。假如你在列表中看不到特定的型号,选择一个最接近它的然后继续。
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/printersharingubuntu3.png)
以上这些都搞定了之后,你的打印机就安装好咯,可以使用了
以上这些都搞定了之后,你的打印机就已安装好,可以使用喽
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/printersharingubuntu4.png)
好好享受吧!
好好享受吧!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/11/daily-ubuntu-tips-print-from-shared-windows-printers/
译者:[Linux-pdz](https://github.com/Linux-pdz) 校对:[校对者ID](https://github.com/校对者ID)
译者:[Linux-pdz](https://github.com/Linux-pdz) 校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,31 @@
每日Ubuntu小技巧让鼠标适合左利手用户
================================================================================
电脑的鼠标被设计成使用食指(大拇指旁边的那个手指)完成大部分操作。默认情况下鼠标为右利手用户配置。打开电脑时,多数情况下你会使用食指完成点击动作。
事实上,许多左利手用户习惯把鼠标放到键盘的左边,然后用中指进行单击操作。这并不是左利手用户使用鼠标最好的方法。
这个简短的教程为想要正确地使用左手操作鼠标的用户而编写。它将会帮助左利手用户将鼠标设置成用食指点击鼠标主键的操作模式。
这个教程同样适用于右利手用户。如果鼠标为左利手用户设置,那么右利手用户可以使用这个教程将鼠标键切换回来。
好了,现在咱们开始吧,点击顶部右端面板中的齿轮按钮选择**System Settings系统设置**...
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/mouse-left-handed.png)
然后在系统设置选项中选择**Mouse & Touchpad (鼠标和触摸板)**,打开后选择‘**Right(右)**’选项,这样就可以改变鼠标的主键以适应左利手用户。
![](http://www.liberiangeek.net/wp-content/uploads/2013/11/mouse-left-handed-1.png)
改回左以适应右利手用户。改变将会在选择后立即生效。
就是这样了。现在左撇子用户可以将鼠标移到键盘左边,用左手的食指来正确地操作鼠标了。
使用愉快!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/11/daily-ubuntu-tipsmake-the-mouse-left-handed-for-left-hand-users/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,54 +1,58 @@
Linux 下使用Trickle管理和限制下载/上传带宽
================================================================================
你有没有遇到过一个程序占用了你所有的网络带宽的情况?如果你遇到过,那么你就需要限制带宽的应用。或者你是一个系统管理员或者只是一名Linux用户你需要学习如何控制应用的上传和下载速度来确保你的网络带宽不会被一个程序耗光。
你有没有遇到过一个程序占用了你所有的网络带宽的情况?如果你遇到过,那么你就需要限制带宽的应用。不管你是一个系统管理员还是一名普通Linux用户您都要学习如何控制应用的上传和下载速度来确保你的网络带宽不会被一个程序耗光。
![](http://www.tecmint.com/wp-content/uploads/2013/11/Bandwidth-limit-trickle.png)
### Trickle 是什么? ###
**Trickle**是一款用来限制如**Firefox, FTP , SSH**和其他程序带宽使用的带宽限制工具来确保网络带宽。你希望你的**Youtube**音乐体验影响到你的ftp下载么不过不想继续阅读这篇文章你会学到如何安装和使用trickle在你的机器上。
**Trickle**是一款带宽整形器,用来限制如**Firefox, FTP , SSH**以及其他使用网络带宽的程序的带宽使用。你希望你的**Youtube**音乐体验影响到你的ftp下载么如果不想请继续阅读这篇文章学习如何在你的机器上安装和使用trickle。
### 怎样在Linux上安装Trickle ###
trickle有它自己的依赖你必须在安装和使用trickle之前安装了“**libevent 库**”但这个在大多数现在Linux机器上已经默认安装。
trickle工具有它自己的依赖包安装和使用trickle之前必须安装“**libevent 库**”不过这个库在大多数现在的Linux机器上已经默认安装。
#### 在 Debian/Ubuntu/Linux Mint 上####
在**Debian/Ubuntu/Mint** 机器上运行 **apt-get install trickle**会有效。请确保源列表已经更新,接着安装你想要的应用。
在**Debian/Ubuntu/Mint** 机器上运行 **apt-get install trickle**进行安装。请确保源列表已经更新,接着安装你想要的应用。
$ sudo apt-get update
$ sudo apt-get install trickle
#### 在 RHEL/CentOS/Fedora 上####
首先你需要更新系统接着使用接下来的命令安装trickle。
首先你需要更新系统,然后使用下面的命令安装trickle。
# yum update
# yum install trickle
### Trickle如何工作? ###
Trickle通过控制某个socket数据的写入和读取数量来控制和限制应用的**上传/下载**速度。它使用另一个版本的**BSD**套接字API但是区别是trickle还管理socket调用。
Trickle通过控制socket数据读写量来控制和限制应用的**上传/下载**速度。它使用另一个版本的**BSD**套接字API但是区别是trickle还管理socket调用。
要注意的是trickle使用动态链接和加载所以它只对于使用"Glibc库"的程序有用。由于trickle可以设置数据在socket上的传输延迟显然它可以用来限制一个应用的网络带宽。
要注意的是trickle使用动态链接和加载所以它只对于使用"Glibc库"的程序有用。由于trickle可以设置数据在socket的传输延迟因此它明显可以用来限制一个应用的网络带宽。
### Trickle不能做什么 ###
Trickle不能限制使用**UDP**协议的应用的带宽,它只可用于**TCP**连接,但是你要知道它也并不是可以工作在所有的**TCP**连接。如果你到现在仔细地看了这篇文章你可以猜到原因是什么。你能回忆起trickle可以工作在使用**Glibc库**应用的事实么?
Trickle不能用于限制使用**UDP**协议的应用的带宽,它只可用于**TCP**连接,但是你要知道它也并不是对所有的**TCP**连接有效。如果你一直仔细地看这篇文章你可以猜到原因是什么。你还记得trickle只对使用**Glibc库**应用有效吧?
还要说一下,trickle无法工作在使用静态链接的可执行程序上。
我不得说一下trickle无法工作在使用静态链接的可执行程序上。
### 确定Trickle是否可运行在某个特定应用上 ###
既然trickle无法显示每个应用的**上传/下载**速度,那么有理由要使用一个方法来找出trickle可以工作的应用。
既然trickle无法限制每个应用的**上传/下载**速度,就应该有个方法找出trickle可以工作的应用。
**ldd**工具可以帮我们找出某个特定的程序是否使用了**libc.so**库。如果程序使用了这个库,那么你可以使用trickle来限制它的网络带宽使用。
**ldd**工具可以帮我们找出某个特定的程序是否使用了**libc.so**库。如果程序使用了这个库,可以使用trickle来限制它的网络带宽使用。
**ldd**命令被用来打印每个程序需要的共享库。如果你是一个好奇的**Linux Geek**那么你可以使用man命令来找出关于ldd工具的更多信息。
**ldd**命令用于打印每个程序需要的共享库。如果你是一个好奇的**Linux Geek**那么你可以使用man命令来找出关于ldd工具的更多信息。
# man ldd
**Filezilla**是一款使用ftp协议传输文件的程序trickle可以用来限制它的下载或者上传速度么在你考虑的时候我使用以下的命令来找出trickle是否可用filezilla。
**Filezilla**是一款使用ftp协议传输文件的程序trickle可以用来限制它的下载或者上传速度么在你考虑的时候我使用以下的命令来找出trickle是否可用filezilla。
# ldd filezilla | grep libc.so
@ -61,12 +65,12 @@ Trickle不能限制使用**UDP**协议的应用的带宽,它只可用于**TCP*
### 学习如何使用Trickle ###
打印下面的命令打印trickle工具的**版本**。
使用下面的命令打印trickle工具的**版本**。
root@oltjano-X55CR:~# trickle -V
trickle: version 1.07
Linux有很多命令行工具使得测试(实验)变得有趣和美丽。下载的命令使用[wget 工具][1]来下载最新的Pear OS镜像
Linux有很多命令行工具使测试(实验)变得有趣和美丽。下面的命令使用[wget 工具][1]来下载最新的Pear OS镜像.
root@oltjano-X55CR:~# wget http://sourceforge.net/projects/pearoslinux/files/Pear%20OS%208/pearos8-i386.iso/download
@ -88,8 +92,7 @@ root@oltjano-X55CR:~# wget http://sourceforge.net/projects/pearoslinux/files/Pea
Saving to: download
0% [ ] 30,78,278 381KB/s eta 1h 50m
如你所见的输出,下载速度大约是**381 KB/s**。我想限制下载速度到**13 K/s**这样我就可以用我的带宽做其他的事情了。下面的命令用来限制wget速度到**13 K/s**。
从输出可以看到,下载速度大约是**381 KB/s**。我想限制下载速度到**13 K/s**这样我就可以用我的带宽做其他的事情了。下面的命令用来限制wget速度到**13 K/s**。
root@oltjano-X55CR:~# trickle -d 13 wget http://sourceforge.net/projects/pearoslinux/files/Pear%20OS%208/pearos8-i386.iso/download
@ -114,15 +117,15 @@ root@oltjano-X55CR:~# wget http://sourceforge.net/projects/pearoslinux/files/Pea
0% [ ] 2,01,550 13.1KB/s eta 21h 5m
如你所见的输出,下载速度被限制到了**13K/s**。下载将会持续**21小时5分钟**。上面的“**-d**”意味着下载,你可以像下面的命令那样结合使用 “**-d**”选项和上传选项(**-u**)。
从输出可以看到,下载速度被限制到了**13K/s**。下载将会持续**21小时5分钟**。上面的“**-d**”选项表示下载,还可以结合使用 “**-d**”选项和上传选项(**-u**),如下例所示
# trickle -u 100 -d 50 ftp
上面的命令限制**ftp 客户端**的上传速度为**100K/s**,下载速度为**50K/s**。你还可以在一个bash里面限制所有的命令的带宽。
上面的命令限制**ftp 客户端**的上传速度为**100K/s**,下载速度为**50K/s**。还可以使用下面的命令,限制在一个shell里运行的所有命令的带宽。
trickle -d 130 -u 13 bash
每个命令行工具对用户提供了帮助使用trickle命令使用"-h"选项来找出更多trickle工具的用法。
每个命令行工具都对用户提供了帮助,使用"trickle -h"命令来找出更多trickle工具的用法。
root@oltjano-X55CR:/usr/bin# trickle -h
@ -143,13 +146,13 @@ root@oltjano-X55CR:/usr/bin# trickle -h
### 总结 ###
本篇文章教你如何安装trickle工具在你的Linux机器上,并用它如何做一些简单的事情。无论你为大公司还是为你自己trickle都是高级Linux用户的必备工具。
本篇文章介绍如何在Linux机器上安装trickle工具,并用它如何做一些简单的事情。无论你为大公司工作还是自己使用trickle都是高级Linux用户的必备工具。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
译者:[geekpi](https://github.com/geekpi) 校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,290 @@
难以置信! 30个top命令示例以及截图
================================================================================
Linux中的top命令显示系统上正在运行的进程。它是系统管理员最重要的工具之一。被广泛用于监视服务器的负载。在本篇中我们会探索top命令的细节。top命令是一个交互命令。在运行top的时候还可以运行很多命令。我们也会探索这些命令。
### 1. Top 命令输出: ###
首先让我们理解一下输出。top命令会显示系统的很多信息。我们需要理解不同部分输出的意义默认运行top命令会显示如下输出
![Top default display](http://linoxide.com/wp-content/uploads/2013/11/01.top_default.png)
First few lines are horizontal showing summary about different system 前几行水平显示了不同系统参数的概括,接下来是进程和它们在列中的属性。
#### 1.1 系统运行时间和平均负载: ####
![Uptime display](http://linoxide.com/wp-content/uploads/2013/11/02.top_uptime.png)
top命令的顶部显示与uptime命令相似的输出。
这些字段显示:
- 当前时间
- 系统运行的时间
- 登陆用户的数量
- 相应最近5、10和15分钟内的平均负载。
无法使用'l'命令触发uptime的显示。
#### 1.2 任务: ####
![Task summary](http://linoxide.com/wp-content/uploads/2013/11/03.top_tasks.png)
第二行显示的是任务或者进程的总结。进程可以在不同的状态。他显示了全部进程的数量。除此之外,还有正在运行、睡眠、停止、僵尸进程的数量(僵尸是一种进程的状态,这些进程概括可以用't'触发)。
#### 1.3 CPU 状态: ####
![CPU status display](http://linoxide.com/wp-content/uploads/2013/11/04.top_cpu_states.png)
下一行显示的是CPU状态。 这里显示了不同模式下的CPU时间 %age。这些不同的CPU时间表示:
- us, user 运行(未调整优先级的) 用户进程的CPU时间
- sysystem: 运行内核进程的CPU时间
- niniced运行已调整优先级的用户进程的CPU时间
- waIO wait: 用于等会IO完成的CPU时间
- hi处理硬件中断的CPU时间
- si: 处理软件中断的CPU时间
- st被hypervisor偷去用于vm的CPU时间。
这个无法使用't'命令触发。
#### 1.4 内存使用: ####
![Memory usage](http://linoxide.com/wp-content/uploads/2013/11/05.top_mem_usage.png)
接下来两行显示内存使用率,有点像'free'命令。第一行是物理内存使用,第二行是虚拟内存使用(交换空间)。
物理内存显示如下:全部可用内存、已使用内存、空闲内存、缓冲内存。相似地:交换反映的是:全部、已使用、空闲和缓冲交换空间。内存显示可以用'm'命令触发。
#### 1.5 字段/列: ####
![Top columns](http://linoxide.com/wp-content/uploads/2013/11/06.top_fields.png)
在水平的系统属性和状态后,下面是以列显示的进程。不同的列代表下面要讨论的不同的属性。
默认上top显示这些关于进程的属性。
**PID**
进程ID进程的唯一标识符
**USER**
进程所有者的实际用户名。
**PR**
进程的调度优先级。这个字段的一些值是'rt'。这意味这这些进程运行在实时态。
**NI**
进程的nice值。低的值意味这更高的优先级。
**VIRT**
进程使用的虚拟内存。
**RES**
驻留内存大小。驻留内存是任务使用的非交换物理内存大小。
**SHR**
SHR是进程使用的共享内存。
**S**
这个是进程的状态。它有以下不同的值:
- D - 不可中断的睡眠态。
- R 运行态
- S 睡眠态
- T 被追踪或已停止
- Z 僵尸态
**%CPU**
自从上一次更新时到现在任务所使用的CPU时间百分比。
**%MEM**
进程使用的可用物理内存百分比。
**TIME+**
任务启动后到现在所使用的全部CPU时间精确到百分之一秒。
**COMMAND**
运行进程所使用的命令。
还有许多在默认情况下不会显示的输出它们可以显示进程的页错误、有效组和组ID和其他更多的信息。
### 2. 交互命令: ###
我们之前讨论过top是一个交互命令。上一章我们已经遇到了一些命令。这里我们会探索更多的命令。
#### 2.1 h: 帮助 ####
首先,我们可以用'h'或者'?'显示交互命令的帮助菜单。
![Help options](http://linoxide.com/wp-content/uploads/2013/11/07.top_help.png)
#### 2.2 <ENTER> 或者 <SPACE>: 刷新显示 ####
top命令默认在一个特定间隔(3秒)后刷新显示。要手动刷新,用户可以输入回车或者空格。
#### 2.3 A: 触发交替显示模式 ####
这个命令在全屏和交替模式间切换。在交替模式下会显示4个窗口:
1. Def
2. Job
3. Mem
4. Usr
四个字段都有唯一独立的可配置的概括区域和它自i就的任务驱动。4个窗口中只有一个窗口会成为当前窗口。当前窗口显示在左上方。
![Alternative display mode](http://linoxide.com/wp-content/uploads/2013/11/08.top_alternative_display.png)
我们可以用'a'和'w'在4个 窗口间切换。'a'移到后一个窗口,'w'移到前一个窗口。用'g'命令你可以输入一个数字来选择当前窗口。
![Window selection in alternative display](http://linoxide.com/wp-content/uploads/2013/11/09.top_alternate_window_selection.png)
#### 2.4 B: 触发粗体显示 ####
Some important information is shown in bold characters. This command toggles use of bold.
一些重要信息会以加粗字体显示。这个命令触发使用粗体。
![Bold off](http://linoxide.com/wp-content/uploads/2013/11/10.top_bold_display_off.png)
#### 2.5 d or s: 设置显示的时间间隔 ####
当按下'd'或's'时你将被提示输入一个值以秒为单位它会以设置的值作为显示间隔。如果你这里输入了1, top将会每秒刷新。
![Display time interval](http://linoxide.com/wp-content/uploads/2013/11/11.top_display_time_interval.png)
#### 2.6 ltm: 触发负载、任务、内存信息 ####
这会相应地触发平均负载、任务/CPU状态和内存信息。
![Load average off](http://linoxide.com/wp-content/uploads/2013/11/12.top_load_average_display_off.png)
![CPU summary off](http://linoxide.com/wp-content/uploads/2013/11/13.top_cpu_display_off.png)
![Memory and swap usage off](http://linoxide.com/wp-content/uploads/2013/11/14.top_mem_display_off.png)
![All three displays off](http://linoxide.com/wp-content/uploads/2013/11/15.top_all_three_display_off.png)
#### 2.7 f: 字段管理 ####
用于选择你想要显示的字段。用'*'标记的是已选择的。
![Managing columns](http://linoxide.com/wp-content/uploads/2013/11/16.top_field_management.png)
< and >
'<'移动已排序的字段到左边,'>'则移动到右边。
#### 2.8 R: 反向排序 ####
触发反向/常规排序。
#### 2.9 c: 触发命令 ####
触发显示进程启动时的完整路径和程序名。
![Full command path](http://linoxide.com/wp-content/uploads/2013/11/17.top_command_name_displayed.png)
#### 2.10 i: Idle Tasks ####
触发空闲任务。
![Idle task display off](http://linoxide.com/wp-content/uploads/2013/11/18.top_idle_tasks_off.png)
#### 2.11 V: 树试图 ####
触发树视图。
![Forest view of tasks](http://linoxide.com/wp-content/uploads/2013/11/19.top_forest_view.png)
#### 2.12 Z: 改变颜色映射 ####
按下'Z'向用户显示一个top命令的输出颜色可以改变的屏幕。这里有8个任务区域和8种颜色。
![Customizing colors](http://linoxide.com/wp-content/uploads/2013/11/20.top_color_selection.png)
下面显示的是4中颜色显示的top视图。
![Colored display](http://linoxide.com/wp-content/uploads/2013/11/21.top_colored.png)
#### 2.13 z: 触发彩色 ####
触发彩色,即打开或关闭彩色显示。
#### 2.14 x 或者 y ####
触发高亮:'x'排序字段;'y'运行进程。依赖于你的显示设置,你可能需要让输出彩色画来通知这些高亮。
![X and Y highlighted](http://linoxide.com/wp-content/uploads/2013/11/22.top_x_y_displayed.png)
#### 2.15 u: 用户的进程 ####
显示特定用户的进程。你会被提示输入用户名。空白将会显示全部用户。
![Processes of 'raghu' user](http://linoxide.com/wp-content/uploads/2013/11/23.top_raghu_processes.png)
#### 2.16 n or #: 任务的数量 ####
设置最大显示的任务数量
![Setting number of tasks displayed](http://linoxide.com/wp-content/uploads/2013/11/24.top_10_processes.png)
#### 2.17 k: 结束任务 ####
top命令中最重要的一个命令。用于发送信号给任务(通常是结束任务)。
![Killing a task](http://linoxide.com/wp-content/uploads/2013/11/25.top_kill_task.png)
#### 2.18 r: 重新调整优先级 ####
重新调整一个任务的调度优先级。
### 3. 命令行选项: ###
大多数这些命令行选项与上面讨论的命令相同。top的输出可以用命令交互操作。但是你可以带参数运行top来设置你想要的。
#### 3.1 -b: 批处理模式 ####
-b选项以批处理模式启动top命令。当你想要在文件中保存输出时是很有用的。
#### 3.2 -c: 命令/程序名 触发: ####
如上面所讨论到的命令,这个选项会以上次记住的程序/命令显示的状态显示。
#### 3.3 -d: 设置延迟间隔 ####
设置top的显示间隔(以秒计)。比如。
$ top -d 1
将会以1s的时间间隔启动top
#### 3.4 -i: 空闲进程触发 ####
这个选项设置top命令的上一次记住的相反的'i'状态。
#### 3.5 -n: 设置迭代数量 ####
用-n选项你可以设置top退出前迭代的次数。
$ top -n 3
将会在3次输出后退出。
#### 3.6 -p: 监控特定的PID ####
你可以用-p选项监控指定的PID。PID的值为0将被作为top命令自身的PID。
#### 3.7 -u or -U: 用户名 或者 UID ####
可以用这些选项浏览特定用户的进程。用户名或者UID可以在选项中指定。-p、-u和-U选项是互斥的。同时只可以使用这其中一个选项。当你试图组合使用这些选项时你会得到一个错误:
$ top -p 28453 -u raghu
top: conflicting process selections (U/p/u)
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-command/linux-top-command-examples-screenshots/
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出