Command to create 500 files numbered consecutively?

I just moved all my videos off my camera and onto my HD to make room. Now I want to make 500 AVIs of 1kb each and put them on there so that the numbers of the new videos don’t conflict with the old ones.

Can someone please show me the command for that? Thanks.

Are you sure the camera won’t just continue the sequence? On my DSLR, the camera increments the file name regardless of whether I remove files from the SD card or use a different card entirely.

Good question. I just tried. Nawp, it made “VIDEO 00001”

So, batch files? Help?

I’ve found this utility really useful. It’s available as a free download. It will rename files any want you want (and some you couldn’t have imagined. I mean, who needs to rename files using, say, a base 7 numbering system?).

That’ll do what I need. Thanks, Saintly Loser, from the bottom of my base-7 heart. :slight_smile:

Try the following. I suggest you try with ten files, and if it works then change the “10” to however many files you want.



#!/bin/bash

for i in {1..10}
do
touch file$i.avi
done

Personally, I’d try doing it with Excel and a batch file.

I’d use Excel to make the commands and file names.

Notepad to make the batch file.

I tried the following, worked:


@echo off
cd C:\Batch\
<nul >"new text document1.avi" (set /p tv=)
<nul >"new text document2.avi" (set /p tv=)
<nul >"new text document3.avi" (set /p tv=)
<nul >"new text document4.avi" (set /p tv=)
<nul >"new text document5.avi" (set /p tv=)

That multiple file name changer is probably better. It’s just that I screwed around for 10 minutes getting this to work and may as well post it.

or touch {1..500} but I doubt the OP is using bash.

On all my cameras, there is a menu option whether to continue the numbering sequence or to start from 1 each time. The OP should check for that, just in case.