Skip to content

Instantly share code, notes, and snippets.

@swateek
Created July 16, 2023 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swateek/4dac5e522bfc7b34f663c86e565d00f3 to your computer and use it in GitHub Desktop.
Save swateek/4dac5e522bfc7b34f663c86e565d00f3 to your computer and use it in GitHub Desktop.
Create Random Files & Folders to Test
#!/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