Shell的一些使用方法

获取本机所有用户:
cat /etc/passwd

[b]dd用于复制,从if读出,写到of。if=/dev/zero不产生IO,因此可以用来测试纯写速度。同理of=/dev/null不产生IO,可以用来测试纯读速度。bs是每次读或写 [/b]
1.测/目录所在磁盘的纯写速度:
time dd if=/dev/zero bs=1024 count=1000000 of=/1Gb.file

2.测/目录所在磁盘的纯读速度:
dd if=/kvm/ftp/other/1Gb.file bs=64k |dd of=/dev/null


[b]本目录文件夹占用空间的大小:[/b]
du -h --max-d 1


iostat command
You can also use iostat command which report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. It can be use to find out your system's average CPU utilization since the last reboot.
iostat

You may want to use following command, which gives you three outputs every 5 seconds (as previous command gives information since the last reboot):

iostat -xtc 5 3
iostao -n #能显示各分区的情况


[b]sort -n和sort -g的不同,其实差别就是精度不太一样。-n的精度比较高[/b]

-g, --general-numeric-sort
compare according to general numerical value

-n, --numeric-sort
compare according to string numerical value


[b]scp不限速传输:[/b]
scp -r arcfour 


[b]egrep的使用方法:[/b]
had -cat lisk/mouse/id/* | egrep "^486904|^52776558318873"


[b]uniq找出前面30个字符相同的,取出第一条:[/b]
uniq -d -w 30 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值