Last active
May 26, 2021 18:30
-
-
Save yaasita/21b7e8f2ecf5b63679486eaf156c87f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# version確認 | |
fdupes --version | |
fdupes 2.1.2 | |
# サイズが同じ10Gのファイル | |
ls -l | |
合計 20971536 | |
-rw-r--r-- 1 root root 10737422336 2021/05/06_02:44:42 1.dat | |
-rw-r--r-- 1 root root 10737422336 2021/05/06_02:47:10 2.dat | |
# 4096byteまでは同じ | |
cmp *.dat | |
1.dat 2.dat 異なります: バイト 4097、行 1 | |
# diskキャッシュをクリア | |
echo 3 > /proc/sys/vm/drop_caches | |
# 実行(時間は環境によって異なります) | |
time fdupes . | |
real 2m12.252s | |
user 0m44.251s | |
sys 0m12.606s | |
# 4096byte目に差分を作る | |
echo -n "a" | dd of=1.dat bs=1 seek=4095 conv=notrunc | |
echo -n "b" | dd of=2.dat bs=1 seek=4095 conv=notrunc | |
cmp *.dat | |
1.dat 2.dat 異なります: バイト 4096、行 1 | |
# diskキャッシュをクリア | |
echo 3 > /proc/sys/vm/drop_caches | |
# 実行 | |
time fdupes . | |
real 0m0.224s | |
user 0m0.004s | |
sys 0m0.007s | |
# 4096byte内に差分があるため(ハッシュ値が違うため)高速 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment