Created
July 16, 2023 14:04
-
-
Save swateek/4dac5e522bfc7b34f663c86e565d00f3 to your computer and use it in GitHub Desktop.
Create Random Files & Folders to Test
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 | |
current_time=$(date "+%Y_%m_%dT%H_%M_%S") | |
rm -rf .my_job 2> /dev/null | |
mkdir -p .my_job | |
mkdir -p .my_job/{100,101,102,103,104,105,106,107,108,109,110} | |
ls -d .my_job/* | xargs -I {} bash -c "cd '{}' && touch sample_$random_$current_time.txt" | |
curl -s -X GET https://filesamples.com/samples/document/csv/sample4.csv -o .my_job/sample_$current_time.csv | |
curl -s -X GET https://filesamples.com/samples/document/pdf/sample2.pdf -o .my_job/sample_$current_time.pdf | |
curl -s -X GET https://filesamples.com/samples/document/xls/sample3.xls -o .my_job/sample_$current_time.xls | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment