Create several files at once

It would be normal to write a command like this:

touch song1.mp3 song2.mp3 song3.mp3 song4.mp3 song5.mp3 song6.mp3

But a more efficient way to do it would be:

$ touch song{1..6}.mp3
$ ll
total 0
-rw-rw-r--. 1 castorga castorga  0 Aug 25 18:25 song1.mp3
-rw-rw-r--. 1 castorga castorga  0 Aug 25 18:25 song2.mp3
-rw-rw-r--. 1 castorga castorga  0 Aug 25 18:25 song3.mp3
-rw-rw-r--. 1 castorga castorga  0 Aug 25 18:25 song4.mp3
-rw-rw-r--. 1 castorga castorga  0 Aug 25 18:25 song5.mp3
-rw-rw-r--. 1 castorga castorga  0 Aug 25 18:25 song6.mp3
##other example:
$ touch file_{a..z}

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *