shell脚本,while for 循环

1、循环100次fio指令,写磁盘压力测试,测试快速写文件的速度

while true

do

for i in {1...1170};do

echo "===================> i < = = = = = = = = = = = = = = = = = = " f i o − − n a m e = r w t e s t i <==================" fio --name=rw_test i<=================="fio−−name=rwtesti --iodepth=32 --rw=write -bs=512Ki --direct=1 --size=100Mi --numjobs=1 --runtime=240 --group_reporting --ioengine=libaio

sleep 0.8

if [ ( ( (( ((i % 100)) == 0 ];then

df -h

fi

done

done

2、或第二种写法

#!bin/bash

cnt=1

while [ $cnt -lt 50 ]

do

echo "dd cnt $cnt" > /dev/console

复制代码
     dd if=/dev/zero of=/mnt/data/test_${cnt}.txt bs=1024 count=102400
     
     let cnt++

     sleep 1

done

相关推荐
石像鬼₧魂石2 小时前
内网渗透靶场实操清单(基于 Vulhub+Metasploitable 2)
linux·windows·学习·ubuntu
橘子真甜~3 小时前
C/C++ Linux网络编程15 - 网络层IP协议
linux·网络·c++·网络协议·tcp/ip·计算机网络·网络层
拾贰_C4 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
阿华hhh5 小时前
Linux系统编程(标准io)
linux·开发语言·c++
石像鬼₧魂石5 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan5 小时前
linux上面写python3日志服务器
linux·运维·服务器
Rose sait6 小时前
【环境配置】Linux配置虚拟环境pytorch
linux·人工智能·python
叶之香7 小时前
CentOS/RHEL 7、8安装exfat和ntfs文件系统
linux·运维·centos
一世琉璃白_Y7 小时前
pg配置国内数据源安装
linux·python·postgresql·centos