Created
June 13, 2023 07:40
-
-
Save uncelvel/13c1ec4dd067ccd237be5e7b381d9bd9 to your computer and use it in GitHub Desktop.
create_and_rename.sh
This file contains hidden or 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
#!/bin/bash | |
# Script Gen file and rename file | |
number_small_file=1000 | |
number_large_file=500 | |
#sudo apt install pwgen -y | |
# ================ Small file ================ | |
# Create and rename | |
for i in $(seq 1 $number_small_file); | |
do | |
pwgen -ysBv 8 1 > small_$i.txt | |
mv small_$i.txt small_$i.txt_rename1 | |
done | |
# Create only small file | |
for i in $(seq 1 $number_small_file); | |
do | |
pwgen -ysBv 8 1 > small_$i.txt | |
done | |
# Rename only small file | |
for i in $(seq 1 $number_small_file); | |
do | |
mv small_$i.txt large_$i.txt_rename2 | |
done | |
echo "======Done small==============" | |
# ================ Large file ================ | |
# Create large file | |
for i in $(seq 1 $number_large_file); | |
do | |
pwgen -ysBv 1024 1 > large_$i.txt | |
mv large_$i.txt large_$i.txt_rename1 | |
done | |
# Create only large file | |
for i in $(seq 1 $number_large_file); | |
do | |
pwgen -ysBv 1024 1 > large_$i.txt | |
done | |
# Rename only large file | |
for i in $(seq 1 $number_large_file); | |
do | |
mv large_$i.txt large_$i.txt_rename2 | |
done | |
echo "======Done large==============" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment