参数 -d 表示,显示设备(磁盘)使用状态;-k某些使用block为单位的列强制使用Kilobytes为单位;1 10表示,数据显示每隔1秒刷新一次,共显示10次。
%user:CPU处在用户模式下的时间百分比。
%nice:CPU处在带NICE值的用户模式下的时间百分比。
%system:CPU处在系统模式下的时间百分比。
%iowait:CPU等待输入输出完成时间的百分比。
%steal:管理程序维护另一个虚拟处理器时,虚拟CPU的无意识等待时间百分比。
%idle:CPU空闲时间百分比。
disk属性值说明:
rrqm/s: 每秒进行 merge 的读操作数目。即 rmerge/s
wrqm/s: 每秒进行 merge 的写操作数目。即 wmerge/s
r/s: 每秒完成的读 I/O 设备次数。即 rio/s
w/s: 每秒完成的写 I/O 设备次数。即 wio/s
rsec/s: 每秒读扇区数。即 rsect/s
wsec/s: 每秒写扇区数。即 wsect/s
rkB/s: 每秒读K字节数。是 rsect/s 的一半,因为每扇区大小为512字节。
wkB/s: 每秒写K字节数。是 wsect/s 的一半。
avgrq-sz: 平均每次设备I/O操作的数据大小 (扇区)。
avgqu-sz: 平均I/O队列长度。
await: 平均每次设备I/O操作的等待时间 (毫秒)。
svctm: 平均每次设备I/O操作的服务时间 (毫秒)。
%util: 一秒中有百分之多少的时间用于 I/O 操作,即被io消耗的cpu百分比
上面看到,磁盘每秒传输次数平均约400;每秒磁盘读取约5MB,写入约1MB。
可以看到磁盘的平均响应时间<5ms,磁盘使用率>80。磁盘响应正常,但是已经很繁忙了(主要是看%util和svctm)。
如果 %util 接近 100%,说明产生的I/O请求太多,I/O系统已经满负荷,该磁盘可能存在瓶颈。 idle小于70% IO压力就较大了,一般读取速度有较多的wait。
同时可以结合vmstat 查看查看b参数(等待资源的进程数)和wa参数(IO等待所占用的CPU时间的百分比,高过30%时IO压力高)。
另外 await 的参数也要多和 svctm 来参考。差的过高就一定有 IO 的问题。avgqu-sz 也是个做 IO 调优时需要注意的地方,这个就是直接每次操作的数据的大小,如果次数多,但数据拿的小的话,其实 IO 也会很小。如果数据拿的大,才IO 的数据会高。也可以通过 avgqu-sz × ( r/s or w/s ) = rsec/s or wsec/s。也就是讲,读定速度是这个来决定的。
svctm 一般要小于 await (因为同时等待的请求的等待时间被重复计算了),svctm 的大小一般和磁盘性能有关,CPU/内存的负荷也会对其有影响,请求过多也会间接导致 svctm 的增加。await 的大小一般取决于服务时间(svctm) 以及 I/O 队列的长度和 I/O 请求的发出模式。如果 svctm 比较接近 await,说明 I/O 几乎没有等待时间;如果 await 远大于 svctm,说明 I/O 队列太长,应用得到的响应时间变慢,如果响应时间超过了用户可以容许的范围,这时可以考虑更换更快的磁盘,调整内核 elevator 算法,优化应用,或者升级 CPU。
参考资料:
http://blog.csdn.net/gxiaop/article/details/55098842
http://www.orczhou.com/index.php/2010/03/iostat-detail/
2. Linux中如何使用VI 来合并两个文件
合并用cat file1 file2 > file_merged啊。。。。为什么要用vim....
vim也可以的,先vi打开文件1,然后光标移到你要插入文件2的地方(合并就是移到文件尾并新建一行),敲
:r /path/to/the/file/you/want/to/merge
3. Linux 里面iostat命令作用是什么
iostat 可以提供更丰富的IO性能状态数据
iostat提供几个用于定制输出的开关。最有用的有:
-c 只显示CPU行
-d 显示设备(磁盘)使用状态
-k 以千字节为单位显示磁盘输出
-t 在输出中包括时间戳
-x 在输出中包括扩展的磁盘指标
rrqm/s: 每秒进行 merge 的读操作数目。
wrqm/s: 每秒进行 merge 的写操作数目。
r/s: 每秒完成的读 I/O 设备次数。
w/s: 每秒完成的写 I/O 设备次数。
rsec/s: 每秒读扇区数。
wsec/s: 每秒写扇区数。
rkB/s: 每秒读K字节数。是 rsect/s 的一半,因为每扇区大小为512字节。(需要计算)
wkB/s: 每秒写K字节数。是 wsect/s 的一半。(需要计算)
avgrq-sz: 平均每次设备I/O操作的数据大小 (扇区)。
avgqu-sz: 平均I/O队列长度。
await: 平均每次设备I/O操作的等待时间 (毫秒)。
svctm: 平均每次设备I/O操作的服务时间 (毫秒)。
%util: 一秒中有百分之多少的时间用于 I/O 操作。
关于Merge的解释:当系统调用需要读取数据的时 候,VFS将请求发到各个FS,如果FS发现不同的读取请求读取的是相同Block的数据,FS会将这个请求合并Merge
await:每一个IO请求的处理的平均时间(单位是毫秒)。这里可以理解为IO的响应时间,一般地系统IO响应时间应该低于5ms,如果大于10ms就比较大了。
%util:在统计时间内所有处理IO时间,除以总共统计时间。例如,如果统计间隔1秒,该 设备有0.8秒在处理IO,而0.2秒闲置,那么该设备的%util = 0.8/1 = 80%,所以该参数暗示了设备的繁忙程度。一般地,如果该参数是100%表示设备已经接近满负荷运行了(当然如果是多磁盘,即使%util是100%,因 为磁盘的并发能力,所以磁盘使用未必就到了瓶颈)。
4. linux命令之ls -al
ls -al命令来观察文件权限,每个文件的权限都用10位表示,其中第一段占1位,表示第一个字符代表这个文件的类型(目录,文件或链接文件)。
若为“d”则是目录,若为“-”则是文件,若为“l”则表示链接文件,若为“”则表示为设备文件里面的可供存储的周边设备,若为“c”则表示为设备文件里面的串行端口设备,如键盘鼠标。
第二段占3位,表示权限,均为[rwx]的三个参数的组合。其中r表示可读,w表示可写,x表示可执行,如果没有权限,则会显示减号“-”。
(4)linuxmerge命令行扩展阅读:
Linux命令注意事项:
Linux的命令(也包括文件名等等)对大小写是敏感的,也就是说,如果你输入的命令大小写不对的话,系统是不会做出你期望的响应的。
Linux常用的命令:
clear,这个命令是用来清除屏幕的,它不需要任何参数,和dos下面的cls具有相同的功能,如果你觉得屏幕太紊乱,就可以使用它清除屏幕上的信息。
目录切换(cd),使用cd(Change Directory)命令可以在不同目录之间切换。
列出目录中的文件(ls),在Linux命令行终端中使用的最多的命令就是这个ls,它可以帮助我们列出当前目录下都有哪些文件。
参考资料来源:网络-Linux命令
5. linux下如何获得特定字符串前后几行文本
这行命令可以帮助你删除包含 Merge 的 commit 块(任意多个这样的文字块)
sed-n'/commit/{:a;h;n;/Merge/b;:c;H;n;$bd;/commit/!bc;:d;x;p;x;ba}'log>log.txt
运行效果如下:
我的命令可能复杂了些。稍微解释一下,仅供参考:
其中:a:b:c:d是命令跳转标签label
/commit/{:a;h;n;
当某行找到 commit 时,将此行复制到 hold space,然后读取下一行。
/Merge/b;
如果刚刚读取到的新行,包含Merge,则结束对本行的处理,读取下一行,并继续寻找commit
如果刚刚读取到的新行,不包含Merge,那么继续对本行执行后续命令:
:c;H;n;$bd;/commit/!bc;:d;x;p;x;ba}
将此行追加到hold space,读取下一行,如果没有到最后一行,并且没有找到commit,那么执行命令bc,跳转到c标签——循环这个过程,直到读取到文件末尾或者读取到包含commit的行。然后,x,将hold space的内容与 pattern space的内容对调,p,输出pattern space的内容(即,不包含Merge的块),x,再次对调,pattern space变成之前的内容(文件末尾或者包含commit的行)。ba,跳转到标签a,继续对此行进行检查,重复步骤1,2,3。
如果上面的命令改为:
sed -n '/commit/{:a;h;n;/Merge/!b;:c;H;n;$bd;/commit/!bc;:d;x;p;x;ba}' log > log.txt
那么,输出结果为,只包含 Merge 的 commit 块
6. Autodock vina 和MGL tools linux版本操作(命令行操作)
蛋白质Edit——加polar H,加Kollman电荷后,Grid——Macromolecule——choose,自动保存pro1.pdbqt
配体 Ligand——Input——QuickSetup,自动保存.out.pdbqt
receptor = clusters_0001_model1.pdbqt
ligand = hypericin.out.pdbqt
center_x = 2.148 (第一个文件可以由Docking——output——Vina生成)
center_y = 3.704
center_z = -2.81
size_x = 74.55 (大于30*30*30,要增加exhaustiveness)
size_y = 74.55
size_z = 74.55
out = cluster1_hypericin_out.pdbqt
log = cluster1_hypericin_out.log
exhaustiveness=24(可以多少个CPU设置多少个,并行计算,exhaustiveness控制一个docking过程重复计算多少次,越高花时间越长,但也不要设置特别大,也没有意义,要在效率和准确度找一个平衡点)
num_modes=30 (不一定输出30个,可能只找到<30构象,也有可能被energy_range限制 )
energy_range=6 (kcal/mol)
(柔性残基信息:flex=side_chains.pdbqt)
vina --config config1.txt
用pymol打开cluster1_hypericin_out.pdbqt看结果
以下为详细设置和操作:
1. 首先用MGLtools准备蛋白和小分子的坐标文件(pdbqt)
蛋白质: 加氢(Add all hydrogens or just non-polar hydrogens. Merge non-polar hydrogens and their charges with their parent carbon atom)、计算电荷(Assign partial atomic charges to the ligand and the macromolecule (Gasteiger or Kollman United Atom charges))、添加原子类型、柔性残基信息
1. Edit——加polar H,merge nonpolar(自动)后 ,pdbqt中的原子数会改变,加H的时候,可能会重新编号
2.Edit——加Kollman United Atom charges电荷(只能加这个,还可以计算Gasteiger 电荷,其值更负),加电荷后,pdbqt中的电荷会改变
配体分子: 加氢、计算电荷、确定root(扭矩中心),选择可旋转的键 (Set up rotatable bonds in the ligand using a graphical version of AutoTors)。我直接使用的quick setup。
Tips: H的位置是任意的,仅取决于输入文件;电荷AutoDock Vina ignores the user-supplied partial charges. It has its own way of dealing with the electrostatic interactions through the hydrophobic and the hydrogen bonding terms.
保存pdbqt文件:pro1.pdbqt,pro2.pdbqt,pro3.pdbqt,lig1.pdbqt,lig2.pdbqt,lig3.pdbqt
2. 写参数文件 config.txt
eg. config.txt
receptor = clusters_0001_model1.pdbqt
ligand = hypericin.out.pdbqt
center_x = 2.148
center_y = 3.704
center_z = -2.81
size_x = 74.55 (大于30*30*30,要增加exhaustiveness)
size_y = 74.55
size_z = 74.55
out = cluster1_hypericin_out.pdbqt
log = cluster1_hypericin_out.log
exhaustiveness=15
num_modes=30 (不一定输出30个,可能只找到<30构象,也有可能被energy_range限制 )
energy_range=6
Details:
Input:
--receptor arg rigid part of the receptor (PDBQT)
--flex arg flexible side chains, if any (PDBQT)
--ligand arg ligand (PDBQT)
Search space (required): 搜索空间有效地限制了包括柔性侧链在内的可移动原子的位置。
( How big should the search space be?
As small as possible, but not smaller. The smaller the search space, the easier it is for the docking algorithm to explore it. On the other hand, it will not explore ligand and flexible side chain atom positions outside the search space. You should probably avoid search spaces bigger than 30 x 30 x 30 Angstrom, unless you also increase "--exhaustiveness" .)
--center_x arg X coordinate of the center
--center_y arg Y coordinate of the center
--center_z arg Z coordinate of the center
--size_x arg size in the X dimension (Angstroms)
--size_y arg size in the Y dimension (Angstroms)
--size_z arg size in the Z dimension (Angstroms)
Output (optional):
--out arg output models (PDBQT), the default is chosen based on
the ligand file name
--log arg optionally, write log file
Misc (optional):
--cpu arg the number of CPUs to use (the default is to try to detect the number of CPUs or, failing that, use 1)
--seed arg explicit random seed
--exhaustiveness arg (=8) exhaustiveness of the global search (roughly proportional to time): 1+ //使用默认的(或任何给定的)穷尽性设置,用于搜索的时间已经根据原子的数量、flexibility等自发变化。通常情况下,花费额外的时间搜索来降低找不到评分函数的全局最小值的概率是没有意义的,这个概率远远低于该最小值远离本机构象的概率。然而,如果你觉得在exhaustiveness和时间之间的自动平衡是不够的,你可以提高exhaustiveness的数值。这将线性地增加时间,并降低不找到最小值的概率。
--num_modes arg (=9) maximum number of binding modes to generate //改成30
--energy_range arg (=3) maximum energy difference between the best binding //改成 8
mode and the worst one displayed (kcal/mol)
Configuration file (optional):
--config arg the above options can be put here
Information (optional):
--help display usage summary
--help_advanced display usage summary with advanced options
--version display program version
Output:
1. Energy
The predicted binding affinity is in kcal/mol.
2. RMSD
RMSD values are calculated relative to the best mode and use only movable heavy atoms. Two variants of RMSD metrics are provided, rmsd/lb (RMSD lower bound) and rmsd/ub (RMSD upper bound), differing in how the atoms are matched in the distance calculation:
rmsd/ub matches each atom in one conformation with itself in the other conformation, ignoring any symmetry
rmsd' matches each atom in one conformation with the closest atom of the same element type in the other conformation (rmsd' can not be used directly, because it is not symmetric)
rmsd/lb is defined as follows: rmsd/lb(c1, c2) = max(rmsd'(c1, c2), rmsd'(c2, c1))
3. Hydrogen positions
Vina uses a united-atom scoring function. As in AutoDock, polar hydrogens are needed in the input structures to correctly type heavy atoms as hydrogen bond donors. However, in Vina, the degrees of freedom that only move hydrogens, such as the hydroxyl group torsions, are degenerate. Therefore, in the output, some hydrogen atoms can be expected to be positioned randomly (but consistent with the covalent structure). For a united-atom treatment, this is essentially a cosmetic issue.
4. Separate models 用vina_split分割成多个pdbqt
All predicted binding modes, including the positions of the flexible side chains are placed into one multimodel PDBQT file specified by the "out" parameter or chosen by default, based on the ligand file name. If needed, this file can be split into indivial models using a separate program called "vina_split" , included in the distribution.
注意:vina_split 的Windows版本要用cmd来实现,找到vina_split所在的目录,运行vina_split --input **.pdbqt
1. Why am I seeing a warning about the search space volume being over 27000 Angstrom^3?
This is probably because you intended to specify the search space sizes in "grid points" (0.375 Angstrom), as in AutoDock 4. The AutoDock Vina search space sizes are given in Angstroms instead. If you really intended to use an unusually large search space, you can ignore this warning, but note that the search algorithm's job may be harder. You may need to increase the value of the exhaustiveness to make up for it. This will lead to longer run time.
2. The bound conformation looks reasonable, except for the hydrogens. Why?
AutoDock Vina actually uses a united-atom scoring function, i.e. one that involves only the heavy atoms. Therefore, the positions of the hydrogens in the output are arbitrary. The hydrogens in the input file are used to decide which atoms can be hydrogen bond donors or acceptors though, so the correct protonation of the input structures is still important.
3. What does "exhaustiveness" really control, under the hood? (exhaustiveness为the number of runs,并行,可以设为cpu数,可以充分利用)
In the current implementation, the docking calculation consists of a number of independent runs, starting from random conformations. Each of these runs consists of a number of sequential steps. Each step involves a random perturbation of the conformation followed by a local optimization (using the Broyden-Fletcher-Goldfarb-Shanno algorithm ) and a selection in which the step is either accepted or not. Each local optimization involves many evaluations of the scoring function as well as its derivatives in the position-orientation-torsions coordinates. The number of evaluations in a local optimization is guided by convergence and other criteria. The number of steps in a run is determined heuristically, depending on the size and flexibility of the ligand and the flexible side chains. However, the number of runs is set by the exhaustiveness parameter. Since the indivial runs are executed in parallel, where appropriate, exhaustiveness also limits the parallelism. Unlike in AutoDock 4, in AutoDock Vina, each run can proce several results: promising intermediate results are remembered. These are merged, refined, clustered and sorted automatically to proce the final result.
4. Why do I not get the correct bound conformation?
It can be any of a number of things:
If you are coming from AutoDock 4, a very common mistake is to specify the search space in "points" (0.375 Angstrom), instead of Angstroms.
Your ligand or receptor might not have been correctly protonated. (初始结构没有优化好)
Bad luck (the search algorithm could have found the correct conformation with good probability, but was simply unlucky). Try again with a different seed.
The minimum of the scoring function correponds to the correct conformation, but the search algorithm has trouble finding it. In this case, higher exhaustiveness or smaller search space should help. (搜索算法没有找到最优结构,可以增大exhaustiveness或减小search space)
The minimum of the scoring function simply is not where the correct conformation is. Trying over and over again will not help, but may occasionally give the right answer if two wrongs (inexact search and scoring) make a right. Docking is an approximate approach.
Related to the above, the culprit may also be the quality of the X-ray or NMR receptor structure.
If you are not doing redocking, i.e. using the correct inced fit shape of the receptor, perhaps the inced fit effects are large enough to affect the outcome of the docking experiment.(换受体结构)
The rings can only be rigid ring docking. Perhaps they have the wrong conformation, affecting the outcome.
You are using a 2D (flat) ligand as input.
The actual bound conformation of the ligand may occasionally be different from what the X-ray or NMR structure shows.
Other problems
5. How can I tweak the scoring function?
You can change the weights easily, by specifying them in the configuration file, or in the command line. For example
vina --weight_hydrogen -1.2 ...
doubles the strenth of all hydrogen bonds.
我如何调整评分功能?
通过在配置文件或命令行中指定权重,可以轻松地更改权重。例如
vina—weight_hydrogen -1.2…
所有氢键强度的两倍。
Functionality that would allow the users to create new atom and pseudo-atom types, and specify their own interaction functions is planned for the future.
This should make it easier to adapt the scoring function to specific targets, model covalent docking and macro-cycle flexibility, experiment with new scoring functions, and, using pseudo-atoms, create directional interaction models.
6. Why don't I get as many binding modes as I specify with "--num_modes"?
This option specifies the maximum number of binding modes to output. The docking algorithm may find fewer "interesting" binding modes internally. The number of binding modes in the output is also limited by the "energy_range", which you may want to increase.
7. Why don't the results change when I change the partial charges?
AutoDock Vina ignores the user-supplied partial charges. It has its own way of dealing with the electrostatic interactions through the hydrophobic and the hydrogen bonding terms. See the original publication [*] for details of the scoring function.
8. How do I use flexible side chains?
You split the receptor into two parts: rigid and flexible, with the latter represented somewhat similarly to how the ligand is represented. See the section "Flexible Receptor PDBQT Files" of the AutoDock4.2 User Guide (page 14) for how to do this in AutoDock Tools. Then, you can issue this command: vina --config conf --receptor rigid.pdbqt --flex side_chains.pdbqt --ligand ligand.pdbqt . Also see this write-up on this subject.
7. linux将文件内容合并并保存
文本文件的话,可以cat old*.txt >new.txt
这样所有old打头文本文件的内容就会合并到一起,到new.txt。
如果是行数相同的两个文件做拼接,可以用merge命令。首先按关键字排好序(sort命令),然后进行merge操作即可。
两个文件合并后,内容横向合并。
8. Linux怎么用命令合并多个文件为一个
有时我们需要对多个文件进行统一操作,那么可以先将多个文件合并为一个,方便很多。下面我就给大家介绍下Linux将多个文件内容合成一个的方法,感兴趣的朋友可以来学习下。
Linux将多个文件内容合成一个的方法
在iDB Cloud 中发现导出的数据库文件是按照每个表生成的SQL文件,这么多单独的文件再导入到其他数据库中是个麻烦事,需要将所有的SQL文件合并为一个完整的SQL文件。有了这个思路,决定寻找方法来实现。
Linux 或 类Unix 下实现合并多个文件内容到一个文件中
代码如下
cat b1.sql b2.sql b3.sql 》 b_all.sql
或者
cat *.sql 》 merge.sql
最后就可以得到一个内容完整的文件了。
此方法适用于将所有文本格式的文件进行内容合并,既是将所有的源代码按照顺序存放在一起。
补充:系统常用维护技巧
1,在 “开始” 菜单中选择 “控制面板” 选项,打开 “控制面板” 窗口,单击 “管理工具” 链接
2,在打开的 “管理工具” 窗口中双击 “事件查看器” 图标
3, 接着会打开 “事件查看器” 窗口
4,在右侧窗格中的树状目录中选择需要查看的日志类型,如 “事件查看器本地--Win日志--系统日志,在接着在中间的 “系统” 列表中即查看到关于系统的事件日志
5,双击日志名称,可以打开 “事件属性” 对话框,切换到 “常规” 选项卡,可以查看该日志的常规描述信息
6,切换到 “详细信息” 选项卡,可以查看该日志的详细信息
7,打开 “控制面板” 窗口,单击 “操作中心” 链接,打开 “操作中心” 窗口,展开 “维护” 区域
8,单击 “查看可靠性历史记录” 链接,打开 “可靠性监视程序” 主界面,如图所示, 用户可以选择按天或者按周为时间单位来查看系统的稳定性曲线表,如果系统近日没出过什么状况, 那么按周来查看会比较合适。观察图中的曲线可以发现,在某段时间内,系统遇到些问题,可靠性指数曲线呈下降的趋势,并且在这段时间系统遇到了三次问题和一次警告,在下方的列表中可以查看详细的问题信息。
相关阅读:系统故障导致死机怎么解决
1、病毒原因造成电脑频繁死机
由于此类原因造成该故障的现象比较常见,当计算机感染病毒后,主要表现在以下几个方面:
①系统启动时间延长;
②系统启动时自动启动一些不必要的程序;
③无故死机
④屏幕上出现一些乱码。
其表现形式层出不穷,由于篇幅原因就介绍到此,在此需要一并提出的是,倘若因为病毒损坏了一些系统文件,导致系统工作不稳定,我们可以在安全模式下用系统文件检查器对系统文件予以修复。
2、由于某些元件热稳定性不良造成此类故障(具体表现在CPU、电源、内存条、主板)
对此,我们可以让电脑运行一段时间,待其死机后,再用手触摸以上各部件,倘若温度太高则说明该部件可能存在问题,我们可用替换法来诊断。值得注意的是在安装CPU风扇时最好能涂一些散热硅脂,但我在某些组装的电脑上却是很难见其踪影,实践证明,硅脂能降低温度5—10度左右,特别是P Ⅲ 的电脑上,倘若不涂散热硅脂,计算机根本就不能正常工作,曾遇到过一次此类现象。该机主要配置如下:磐英815EP主板、PⅢ733CPU、133外频的128M内存条,当该机组装完后,频繁死机,连Windows系统都不能正常安装,但是更换赛扬533的CPU后,故障排除,怀疑主板或CPU有问题,但更换同型号的主板、CPU后该故障也不能解决。后来由于发现其温度太高,在CPU上涂了一些散热硅脂,故障完全解决。实践证明在赛扬533以上的CPU上必须要涂散热硅脂,否则极有可能引起死机故障。
3、由于各部件接触不良导致计算机频繁死机
此类现象比较常见,特别是在购买一段时间的电脑上。由于各部件大多是靠金手指与主板接触,经过一段时间后其金手指部位会出现氧化现象,在拔下各卡后会发现金手指部位已经泛黄,此时,我们可用橡皮擦来回擦拭其泛黄处来予以清洁。
4、由于硬件之间不兼容造成电脑频繁死机
此类现象常见于显卡与其它部件不兼容或内存条与主板不兼容,例如SIS的显卡,当然其它设备也有可能发生不兼容现象,对此可以将其它不必要的设备如Modem、声卡等设备拆下后予以判断。
5、软件冲突或损坏引起死机
此类故障,一般都会发生在同一点,对此可将该软件卸掉来予以解决。
9. Linux下iostat命令详解
iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视。它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况。iostat也有一个弱点,就是它不能对某个进程进行深入分析,仅对系统的整体情况进行分析。
# iostat属于sysstat软件包。可以直接安装。
[root@localhost ~]# yum -y install sysstat
语法
iostat (选项) (参数)
选项
-c:仅显示CPU使用情况;
-d:仅显示设备利用率;
-k:显示状态以千字节每秒为单位,而不使用块每秒;
-m:显示状态以兆字节每秒为单位;
-p:仅显示块设备和所有被使用的其他分区的状态;
-t:显示每个报告产生时的时间;
-V:显示版号并退出;
-x:显示扩展状态。
参数
间隔时间:每次报告的间隔时间(秒);
次数:显示报告的次数。
实例
显示所有设备负载情况
[root@localhost ~]# iostat
说明:
cpu属性值说明:
%user:CPU处在用户模式下的时间百分比。
%nice:CPU处在带NICE值的用户模式下的时间百分比。
%system:CPU处在系统模式下的时间百分比。
%iowait:CPU等待输入输出完成时间的百分比。
%steal:管理程序维护另一个虚拟处理器时,虚拟CPU的无意识等待时间百分比。
%idle:CPU空闲时间百分比。
备注:
如果%iowait的值过高,表示硬盘存在I/O瓶颈
如果%idle值高,表示CPU较空闲
如果%idle值高但系统响应慢时,可能是CPU等待分配内存,应加大内存容量。
如果%idle值持续低于10,表明CPU处理能力相对较低,系统中最需要解决的资源是CPU。
cpu属性值说明:
tps:该设备每秒的传输次数
kB_read/s:每秒从设备(drive expressed)读取的数据量;
kB_wrtn/s:每秒向设备(drive expressed)写入的数据量;
kB_read: 读取的总数据量;
kB_wrtn:写入的总数量数据量;
定时显示所有信息
#【每隔2秒刷新显示,且显示3次】
[root@localhost ~]# iostat 2 3
显示指定磁盘信息
[root@localhost ~]# iostat -d /dev/sda
显示tty和Cpu信息
[root@localhost ~]# iostat -t
以M为单位显示所有信息
[root@localhost ~]# iostat -m
查看设备使用率(%util)、响应时间(await)
#【-d 显示磁盘使用情况,-x 显示详细信息】
# d: detail
[root@localhost ~]# iostat -d -x -k 1 1
说明:
rrqm/s: 每秒进行 merge 的读操作数目.即 delta(rmerge)/s
wrqm/s: 每秒进行 merge 的写操作数目.即 delta(wmerge)/s
%util: 一秒中有百分之多少的时间用于 I/O
如果%util接近100%,说明产生的I/O请求太多,I/O系统已经满负荷,idle小于70% IO压力就较大了,一般读取速度有较多的wait。
查看cpu状态
[root@localhost ~]# iostat -c 1 1
10. linux怎样命令行上传git
你是你是要通过git命令上传东西,还是想上传git到服务器上面,你可以先通过yum安装git
#yuminstallgit
已加载插件:fastestmirror,refresh-packagekit,security
设置安装进程
Loadingmirrorspeedslinuxprobe.comfromcachedhostfile
base|3.7kB00:00
epel|4.3kB00:00
epel/primary_db|5.9MB00:05
extras|3.4kB00:00
hhvm|2.9kB00:00
shells_fish_release_2|1.2kB00:00
updates|3.4kB00:00
updates/primary_db|821kB00:01
upgrade|1.9kB00:00
virtualbox/signature|181B00:00
virtualbox/signature|1.1kB00:00...
包git-1.7.1-8.el6.x86_64已安装并且是最新版本
无须任何处理
#git--help
usage:git[--version][--exec-path[=GIT_EXEC_PATH]][--html-path]
[-p|--paginate|--no-pager][--no-replace-objects]
[--bare][--git-dir=GIT_DIR][--work-tree=GIT_WORK_TREE]
[--help]COMMAND[ARGS]
:
addAddfilecontentstotheindex
branchList,create,,commitandworkingtree,etclogShowcommitlogs
mvMoveorrenameafile,adirectory,orasymlink
rebaseForward-
showShowvarioustypesofobjects
tagCreate,list,
See'githelpCOMMAND'.
下面我给介绍一种从本地上传到服务器的命令:
命令rz和sz命令,首先你需要安装lrzsz库
#rz--help
rzversion0.12.20
Usage:rz[options][filename.if.xmodem]
ReceivefileswithZMODEM/YMODEM/XMODEMprotocol
(X)=optionappliestoXMODEMonly
(Y)=optionappliestoYMODEMonly
(Z)=optionappliestoZMODEMonly
-+,--appendappendtoexistingfiles
-a,--asciiASCIItransfer(changeCR/LFtoLF)
-b,--binarybinarytransfer
-B,--bufsizeNbufferNbytes(N==auto:bufferwholefile)
-c,--with-crcUse16bitCRC(X)
-C,--allow-remote-(Z)
-D,--nullwriteallreceiveddatato/dev/null
--delay-
-e,--escapeEscapecontrolcharacters(Z)
-E,--
--(debugging)
-h,--helpHelp,printthisusagemessage
-m,--min-
-M,--min-bps-timeNforatleastNseconds(default:120)
-O,--disable-timeoutsdisabletimeoutcode,waitforeverfordata
--o-syncopenoutputfile(s)insynchronouswritemode
-p,--protectprotectexistingfiles
-q,--quietquiet,noprogressreports
-r,--(Z)
-R,--restrictedrestricted,moresecuremode
-s,--stop-at{HH:MM|+N}stoptransmissionatHH:MMorinNseconds
-S,--timesyncrequestremotetime(twice:setlocaltime)
--syslog[=off]turnsyslogonoroff,ifpossible
-t,--
-u,--keep-
-U,--(ifallowedto)
-v,--verbosebeverbose,providedebugginginformation
-w,--windowsizeNWindowisNbytes(Z)
-X--xmodemuseXMODEMprotocol
-y,--overwriteYes,clobberexistingfileifany
--ymodemuseYMODEMprotocol
-Z,--zmodemuseZMODEMprotocol
#sz--help
szversion0.12.20
Usage:sz[options]file...
or:sz[options]-{c|i}COMMAND
Sendfile(s)withZMODEM/YMODEM/XMODEMprotocol
(X)=optionappliestoXMODEMonly
(Y)=optionappliestoYMODEMonly
(Z)=optionappliestoZMODEMonly
-+,--(Z)
-2,--twostopuse2stopbits
-4,--try-4kgoupto4Kblocksize
--start-4kstartwith4Kblocksize(doesn'ttry8)
-8,--try-8kgoupto8Kblocksize
--start-8kstartwith8Kblocksize
-a,--asciiASCIItransfer(changeCR/LFtoLF)
-b,--binarybinarytransfer
-B,--bufsizeNbufferNbytes(N==auto:bufferwholefile)
-c,--(Z)
-C,--command-(Z)
-d,--dot-to-slashchange'.'to'/'inpathnames(Y/Z)
--delay-
-e,--(Z)
-E,--
-f,--full-pathsendfullpathname(Y/Z)
-i,--immediate-commandCMDsendremoteCMD,returnimmediately(Z)
-h,--helpprintthisusagemessage
-k,--1ksend1024bytepackets(X)
-L,--(Z)
-l,--(l>=L)(Z)
-m,--min-
-M,--min-bps-timeNforatleastNseconds(default:120)
-n,--newersendfileifsourcenewer(Z)
-N,--newer-or-(Z)
-o,--16-bit-(Z)
-O,--disable-timeoutsdisabletimeoutcode,waitforever
-p,--(Z)
-r,--(Z)
-R,--restrictedrestricted,moresecuremode
-q,--quietquiet(noprogressreports)
-s,--stop-at{HH:MM|+N}stoptransmissionatHH:MMorinNseconds
--
--tcp-serveropensocket,waitforconnection
-u,--
-U,--(ifallowedto)
-v,--verbosebeverbose,providedebugginginformation
-w,--windowsizeNWindowisNbytes(Z)
-X,--xmodemuseXMODEMprotocol
-y,--
-Y,--overwrite-or-skipoverwriteexistingfiles,elseskip
--ymodemuseYMODEMprotocol
-Z,--zmodemuseZMODEMprotocol
.com。