Here is a quick demo. The touch command updates the time the file was last modified or creates it if it does not exist.
for ((i=1; i<=12; i++)); do filename="file$i.txt" touch "$filename" done
You can add leading zeros in cases where $i is just one digit:
for ((i=1; i<=12; i++)); do filename="$(printf "file%02d.txt" "$i")" touch "$filename" done
This will result in file01.txt , file02.txt , etc. instead of file1.txt , file2.txt .
Michael hoffman
source share