Hello,
I am trying to use touch command to create 1200 .txt files. I am using this, but it is not working.
touch `seq 1 1200`.txt
Regards,
Siddhesh.K
Hello,
I am trying to use touch command to create 1200 .txt files. I am using this, but it is not working.
touch `seq 1 1200`.txt
Regards,
Siddhesh.K
my machine don't have seq
command .. Hence an alternate way ..
$ i=1; while [ $i -le 1200 ]; do touch ${i}.txt ; i=$((i+1)) ; done
Try
touch `seq -f%g.txt 1 1200`
use while loop
i=0
while [[ $i -lt 1200 ]]
do
touch ${i}.txt
i=`expr $i + 1`
done
It works on RH4 , let me know if it works for you
$ bash
$ touch {1..10}.txt
$ ls -lrt *.txt
Think about what that would become.
touch 1 2 3 4 5 6 7 8 9 10 11 12 ... .txt
Not what you wanted at all.