dash计算文件夹里所有文件的md5
发表于|更新于|shell
|浏览量:
dash计算文件夹里所有文件的md5
1 | find ./dir/ -type f -print0 | xargs -0 md5sum > md5sum.txt |
文章作者: 火苗
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 IT技术记录小站!
相关推荐

2023-07-31
dash中替代数组的方法
bash中的数组bash脚本test.sh 1234567891011index=10for i in `seq 0 9`do arr[${i}]=${index} index=$((${index}+1))donefor i in `seq 0 9`do echo ${arr[${i}]}done 1234567891011sh test.sh10111213141516171819 dash中的数组替代方法dash脚本test.sh 123456789101112131415161718192021222324252627vector_get(){ local name="$1" local i="$2" eval echo '$'{${name}${i}}}vector_set(){ l...

2023-07-26
shell输出变量丢失换行
shell输出变量丢失换行bash 赋值 1a=`echo -e "a\nb"` 输出 1echo $a 显示: 1a b

2019-12-12
shell中使用if比较数字与字符串
记录shell中的数字与字符串比较操作用法if的格式注意格式: 123if空格[空格$A空格==空格$B空格];then ...fi 空格一定要有,否则判断出错。 正确示例:12345678#!/bin/bash -xA=1B=2if [ A == B ];then echo "B"=$Belse echo "A="$Afi输出A=1错误示例:12345678#!/bin/bash -xA=1B=2if [ A==B ];then echo "B"=$Belse echo "A="$Afi输出B=2 在shell中字符串与数值的比较方法不同1、整数比较:等于 -eq 或 =12345678910111213#!/bin/bash -xif [ 5 = 3 ] ;then echo "A"else echo "B"fi#output:Bif [ 3 -eq 3 ] ;then echo "A&q...

2023-08-22
u盘同时支持BIOS和EFI
盘同时支持BIOS和EFI使用mbr分区u盘/dev/sde 分区12parted -s /dev/sde mklabel msdosparted -s /dev/sde mkpart primary 1M 1G set 1 boot on 格式化分区1mkfs.vfat -F 32 /dev/sde1 挂载12mkdir -p /mnt/1mount /dev/sde1 /mnt/1 安装BIOS1grub-install /dev/sde --boot-directory=/mnt/1/boot --removable --recheck 安装EFI1grub-install /dev/sde --boot-directory=/mnt/1/boot --efi-directory=/mnt/1 --target=x86_64-efi --removable 使用GPT分区暂时未测试成功 测试用的grub.cfg需要手动复制vmlinuz和initrd到/mnt/1/boot,并在/mnt/1/boot/grub下创建grub.cfg 1234567891011121...

2023-07-26
shell调用其它脚本的函数
shell调用其它脚本的函数bash shellname.sh 12345678910test_func(){ local p1="$1" if [ "$p1" == "" ]; then echo "1 null" return 1 fi echo "1 ${p1}" return 0} 12345678. ./shellname.shres=`test_func "123"`if [ $? != "0" ]; then echo "fatal"else echo "ok"fi

2023-08-14
cpio打包initrd.img
cpio打包initrd进入initrd目录执行 不压缩 1find ./ |cpio -o -H newc > ../initrd.img gzip压缩 1find ./ |cpio -o -H newc | gzip > ../initrd.gzip lz4压缩 1find ./ |cpio -o -H newc | lz4 -9 -l > ../initrd.lz4
公告
每天都有一个好心情

