Generate 91 files from file_10.txt to file_100.txt of size 10 Byte to 100 Byte
1. Using truncate command
1 2 3 4 |
for i in {11..100} do truncate -s $i file_$i.txt done |
Command Output


Reference:
- loop in bash : https://www.cyberciti.biz/faq/bash-for-loop/
- truncate command : https://linoxide.com/use-truncate-command-linux/
- Another way: https://gist.github.com/fduran/f678b4b67f559ad505d8
Recent Comments