测试你的硬盘速度

创建一个500MB的空白文件,并计算完成将整个内容写入磁盘所需的时间(同步)

time整个dd + sync操作,然后删除临时文件
适用于Bash; 没有在其他环境中测试过
.

0

linux命令:time (dd if=/dev/zero of=zerofile bs=1M count=500;sync);rm zerofile zerofile count=500;sync);rm bs=1M of=zerofile if=/dev/zero (dd time time (dd if=/dev/zero of=zerofile bs=1M count=500;sync);rm zerofilerootopen.com
linux命令:time (dd if=/dev/zero of=zerofile bs=1M count=500;sync);rm zerofile zerofile count=500;sync);rm bs=1M of=zerofile if=/dev/zero (dd time time (dd if=/dev/zero of=zerofile bs=1M count=500;sync);rm zerofilerootopen.com
wctk 2018-12-22 22:04:54
输出
linux命令:time 详解

评论

相关推荐

*如果要监控吞吐量,则需要PV(管道查看器); 解压缩任意.gz文件(不必是tar)并将其重新压缩为bzip2,它具有更好的压缩和错误恢复。 将错误消息回显到主目录中名为logfile.txt的文件。 注意:不会删除原始.gz文件。如果要节省空间,则必须手动删除它。

linux命令:time gzip -cd file1.tar.gz 2>~/logfile.txt | pv -t -r -b -W -i 5 -B 8M | bzip2 > file1.tar.bz2 2>>~/logfile .txt .txt 2>>~/logfile file1.tar.bz2 > bzip2 | 8M -B 5 -i -W -b -r -t pv | 2>~/logfile.txt file1.tar.gz -cd gzip time time gzip -cd file1.tar.gz 2>~/logfile.txt | pv -t -r -b -W -i 5 -B 8M | bzip2 > file1.tar.bz2 2>>~/logfile .txtrootopen.com
linux命令:time gzip -cd file1.tar.gz 2>~/logfile.txt | pv -t -r -b -W -i 5 -B 8M | bzip2 > file1.tar.bz2 2>>~/logfile .txt .txt 2>>~/logfile file1.tar.bz2 > bzip2 | 8M -B 5 -i -W -b -r -t pv | 2>~/logfile.txt file1.tar.gz -cd gzip time time gzip -cd file1.tar.gz 2>~/logfile.txt | pv -t -r -b -W -i 5 -B 8M | bzip2 > file1.tar.bz2 2>>~/logfile .txtrootopen.com
.

分为两部分,首先使用cat /proc/cpuinfo |grep proc|wc -l获取内核的数量,然后使用该数量创建一个整数序列(xargs seq),然后对给定的命令执行GNU并行循环多次

linux命令:time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "scale=4000\; a\(1\)\*4" '|' bc -l -l bc '|' a\(1\)\*4" "scale=4000\; echo 0 -N seq|parallel -l|xargs proc|wc |grep /proc/cpuinfo cat time time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "scale=4000\; a\(1\)\*4" '|' bc -lrootopen.com
linux命令:time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "scale=4000\; a\(1\)\*4" '|' bc -l -l bc '|' a\(1\)\*4" "scale=4000\; echo 0 -N seq|parallel -l|xargs proc|wc |grep /proc/cpuinfo cat time time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "scale=4000\; a\(1\)\*4" '|' bc -lrootopen.com
.

你可以在所有的核心上都有一个小的基准测试,作为一个多核心的基准测试或者压力测试先找到核心的数量,然后再对它进行平行的迭代,这是并行的

linux命令:time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "2^2^20" '|' bc bc '|' "2^2^20" echo 0 -N seq|parallel -l|xargs proc|wc |grep /proc/cpuinfo cat time time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "2^2^20" '|' bcrootopen.com
linux命令:time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "2^2^20" '|' bc bc '|' "2^2^20" echo 0 -N seq|parallel -l|xargs proc|wc |grep /proc/cpuinfo cat time time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "2^2^20" '|' bcrootopen.com
.

以微秒而不是秒,除了在POSIX 2008中未定义之外(尽管它定义为POSIX 2004,并且它在Linux和其他具有POSIX兼容性历史的平台上显然可用),POSIX 2008标准定义了nanoslee

linux命令:time usleep 100000 100000 usleep time time usleep 100000rootopen.com
linux命令:time usleep 100000 100000 usleep time time usleep 100000rootopen.com
.

NTP代表网络时间协议是一种互联网协议,用于在计算机之间同步系统时钟。该timedatectl实用程序,可以自动使用NTP服务器的远程群组同步Linux系统时钟

linux命令:timedatectl set-ntp true true set-ntp timedatectl timedatectl set-ntp truerootopen.com
linux命令:timedatectl set-ntp true true set-ntp timedatectl timedatectl set-ntp truerootopen.com
.

linux命令:timedatectl set-local-rtc 0 0 set-local-rtc timedatectl timedatectl set-local-rtc 0rootopen.com
linux命令:timedatectl set-local-rtc 0 0 set-local-rtc timedatectl timedatectl set-local-rtc 0rootopen.com
.

linux命令:timedatectl set-local-rtc 1 1 set-local-rtc timedatectl timedatectl set-local-rtc 1rootopen.com
linux命令:timedatectl set-local-rtc 1 1 set-local-rtc timedatectl timedatectl set-local-rtc 1rootopen.com
.

linux命令:timedatectl | grep local local grep | timedatectl timedatectl | grep localrootopen.com
linux命令:timedatectl | grep local local grep | timedatectl timedatectl | grep localrootopen.com
.

linux命令:timedatectl set-time '2018-08-20 16:14:50' 16:14:50' '2018-08-20 set-time timedatectl timedatectl set-time '2018-08-20 16:14:50'rootopen.com
linux命令:timedatectl set-time '2018-08-20 16:14:50' 16:14:50' '2018-08-20 set-time timedatectl timedatectl set-time '2018-08-20 16:14:50'rootopen.com
.

要仅设置日期,我们可以使用日期格式的设置时间YY:MM:DD(年,月,日)

linux命令:timedatectl set-time 20180820 20180820 set-time timedatectl timedatectl set-time 20180820rootopen.com
linux命令:timedatectl set-time 20180820 20180820 set-time timedatectl timedatectl set-time 20180820rootopen.com
.

设置时间,我们可以使用HH:MM:SS(小时,分钟和秒)中的时间格式设置时间切换

linux命令:timedatectl set-time 15:58:30 15:58:30 set-time timedatectl timedatectl set-time 15:58:30rootopen.com
linux命令:timedatectl set-time 15:58:30 15:58:30 set-time timedatectl timedatectl set-time 15:58:30rootopen.com
.

linux命令:timedatectl set-timezone UTC UTC set-timezone timedatectl timedatectl set-timezone UTCrootopen.com
linux命令:timedatectl set-timezone UTC UTC set-timezone timedatectl timedatectl set-timezone UTCrootopen.com
.

linux命令:timedatectl set-timezone “Asia/Shanghai” “Asia/Shanghai” set-timezone timedatectl timedatectl set-timezone “Asia/Shanghai”rootopen.com
linux命令:timedatectl set-timezone “Asia/Shanghai” “Asia/Shanghai” set-timezone timedatectl timedatectl set-timezone “Asia/Shanghai”rootopen.com
.

linux命令:timedatectl list-timezones list-timezones timedatectl timedatectl list-timezonesrootopen.com
linux命令:timedatectl list-timezones list-timezones timedatectl timedatectl list-timezonesrootopen.com
.

linux命令:timedatectl status status timedatectl timedatectl statusrootopen.com
linux命令:timedatectl status status timedatectl timedatectl statusrootopen.com
.

linux命令:time for movie in $(ls -1 /home/$USER/.config/stremio/backgrounds2 | sort -u);do wget -qO- --header="Accept-Language: en" "https://www.imdb.com/title/$movie/" | hxselect -s '\n' -c 'title' 2>/dev/null | tee ~/$(date +%Y-%m-%d_%T)-movie-list.txt ; done done ; +%Y-%m-%d_%T)-movie-list.txt ~/$(date tee | 2>/dev/null 'title' -c '\n' -s hxselect | "https://www.imdb.com/title/$movie/" en" --header="Accept-Language: -qO- wget -u);do sort | /home/$USER/.config/stremio/backgrounds2 -1 $(ls in movie for time time for movie in $(ls -1 /home/$USER/.config/stremio/backgrounds2 | sort -u);do wget -qO- --header="Accept-Language: en" "https://www.imdb.com/title/$movie/" | hxselect -s '\n' -c 'title' 2>/dev/null | tee ~/$(date +%Y-%m-%d_%T)-movie-list.txt ; donerootopen.com
linux命令:time for movie in $(ls -1 /home/$USER/.config/stremio/backgrounds2 | sort -u);do wget -qO- --header="Accept-Language: en" "https://www.imdb.com/title/$movie/" | hxselect -s '\n' -c 'title' 2>/dev/null | tee ~/$(date +%Y-%m-%d_%T)-movie-list.txt ; done done ; +%Y-%m-%d_%T)-movie-list.txt ~/$(date tee | 2>/dev/null 'title' -c '\n' -s hxselect | "https://www.imdb.com/title/$movie/" en" --header="Accept-Language: -qO- wget -u);do sort | /home/$USER/.config/stremio/backgrounds2 -1 $(ls in movie for time time for movie in $(ls -1 /home/$USER/.config/stremio/backgrounds2 | sort -u);do wget -qO- --header="Accept-Language: en" "https://www.imdb.com/title/$movie/" | hxselect -s '\n' -c 'title' 2>/dev/null | tee ~/$(date +%Y-%m-%d_%T)-movie-list.txt ; donerootopen.com
.

最后 ;很重要。例如:time {rm -rf / folder / bar && mkdir -p / folder / bar;回声“完成”; }命令是bash内建的

linux命令:time { <command1> ; <command2> ; <command...> ; } } ; <command...> ; <command2> ; <command1> { time time { <command1> ; <command2> ; <command...> ; }rootopen.com
linux命令:time { <command1> ; <command2> ; <command...> ; } } ; <command...> ; <command2> ; <command1> { time time { <command1> ; <command2> ; <command...> ; }rootopen.com
.

旧的快照可能会导致问题。完成后最好删除它们。我使用这个脚本删除所有快照。 “while read”命令是必需的,因为我的虚拟机名称中包含空格。 “time”命令报告进程运行的时间。

linux命令:time vmware-cmd -l | while read x; do printf "$x"; vmware-cmd "$x" removesnapshots; done done removesnapshots; "$x" vmware-cmd "$x"; printf do x; read while | -l vmware-cmd time time vmware-cmd -l | while read x; do printf "$x"; vmware-cmd "$x" removesnapshots; donerootopen.com
linux命令:time vmware-cmd -l | while read x; do printf "$x"; vmware-cmd "$x" removesnapshots; done done removesnapshots; "$x" vmware-cmd "$x"; printf do x; read while | -l vmware-cmd time time vmware-cmd -l | while read x; do printf "$x"; vmware-cmd "$x" removesnapshots; donerootopen.com
.

时间读取-sn1(s:无声,n:字符数,按任何字符停止)

linux命令:time read (ctrl-d to stop) stop) to (ctrl-d read time time read (ctrl-d to stop)rootopen.com
linux命令:time read (ctrl-d to stop) stop) to (ctrl-d read time time read (ctrl-d to stop)rootopen.com
.

根据您的系统速度,RAM数量和可用磁盘空间量,您可以实际发现磁盘的实际速度。完成时,请将复制的MB数除以显示“真实”秒数的行。在示例输出中,缓存值显示的写入速度为178MB / s,这是不现实的,而使用输出的计算值和秒数表明它更像35MB / s,这是可行的。

linux命令:time (dd if=/dev/zero of=blah.out bs=256M count=1 ; sync ) ) sync ; count=1 bs=256M of=blah.out if=/dev/zero (dd time time (dd if=/dev/zero of=blah.out bs=256M count=1 ; sync )rootopen.com
linux命令:time (dd if=/dev/zero of=blah.out bs=256M count=1 ; sync ) ) sync ; count=1 bs=256M of=blah.out if=/dev/zero (dd time time (dd if=/dev/zero of=blah.out bs=256M count=1 ; sync )rootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令