aboutsummaryrefslogtreecommitdiff
path: root/store/works/life/operating-system-course-design/create-file.bash
blob: 4aa98b876c217f97de75fcd1a0d7b81618d63861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let dir_count=256
let file_count=500;

for dir_iter in `seq $dir_count`; do
    mkdir -p /mnt/fat-test/$dir_iter
    for iter in `seq $file_count`; do
        truncate -s 4KB /mnt/fat-test/$dir_iter/$iter;
    done
    echo "Created 500 files in dir $dir_iter";
done

df

for dir_iter in `seq $dir_count`; do
    mkdir -p /mnt/fat-test/$dir_iter
    for iter in `seq $file_count`; do
        if (($iter % 2 == 0)); then
            rm /mnt/fat-test/$dir_iter/$iter;
        fi
    done
    echo "Deleted 250 files in dir $dir_iter";
done

df

truncate -s 200MB /mnt/fat-test/big;

df