I had to prepare thousands of files at a time to check the operation, so make a note.
I haven't done anything strange. It also worked on Windows Bash (Ubuntu).
touch test.file;for i in {1..5000};do cp test.file test_${i}.file;done
↓ ↓ ↓ This is the same.
touch test_{1..5000}.file
This will create 5,000 (5,001 to be exact) files.
You can create any number of files by changing the 5000
part.
If you want to specify the file size, it looks like this.
dd if=/dev/zero of=test.file bs=1M count=1;for i in {1..5000};do cp test.file test_${i}.file;done
This will create 5,000 1MByte files.
The file size is bs
x count
, so you can specify any file size by changing this.
Recommended Posts