# Command to create 500 files numbered consecutively?

**URL:** <https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273>\
**Category:** Factual Questions\
**Created:** [May 13, 2013, 11:30pm UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273 "2013-05-13T23:30:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brujaja](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@brujaja](https://boards.straightdope.com/u/brujaja)\
**Post date:** [May 13, 2013, 11:30pm UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/1 "2013-05-13T23:30:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gotpasswords](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@gotpasswords](https://boards.straightdope.com/u/gotpasswords)\
**Post date:** [May 13, 2013, 11:38pm UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/2 "2013-05-13T23:38:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brujaja](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@brujaja](https://boards.straightdope.com/u/brujaja)\
**Post date:** [May 13, 2013, 11:40pm UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/3 "2013-05-13T23:40:47Z")

</div>

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

So, batch files? Help?

---

<div class="post-metadata">

**Author:** ![Saintly\_Loser](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saintly_loser/32/4045_2.png) [@Saintly\_Loser](https://boards.straightdope.com/u/Saintly_Loser)\
**Post date:** [May 13, 2013, 11:45pm UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/4 "2013-05-13T23:45:52Z")

</div>

> [@brujaja](#):
>
> 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.

I’ve found [this](http://www.bulkrenameutility.co.uk/Main_Intro.php) 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?).

---

<div class="post-metadata">

**Author:** ![brujaja](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@brujaja](https://boards.straightdope.com/u/brujaja)\
**Post date:** [May 13, 2013, 11:49pm UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/5 "2013-05-13T23:49:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Animastryfe](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Animastryfe](https://boards.straightdope.com/u/Animastryfe)\
**Post date:** [May 14, 2013, 12:13am UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/6 "2013-05-14T00:13:57Z")

</div>

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

```auto

#!/bin/bash

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

```

---

<div class="post-metadata">

**Author:** ![Dave\_Hartwick](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Dave\_Hartwick](https://boards.straightdope.com/u/Dave_Hartwick)\
**Post date:** [May 14, 2013, 12:15am UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/7 "2013-05-14T00:15:47Z")

</div>

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:

```auto

@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.

---

<div class="post-metadata">

**Author:** ![Fubaya](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Fubaya](https://boards.straightdope.com/u/Fubaya)\
**Post date:** [May 14, 2013, 12:57am UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/8 "2013-05-14T00:57:03Z")

</div>

> [@Animastryfe](#):
>
> Try the following. I suggest you try with ten files, and if it works then change the “10” to however many files you want.
> 
> ```auto
> 
> #!/bin/bash
> 
> for i in {1..10}
> do
> touch file$i.avi
> done
> 
> ```

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

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [May 14, 2013, 1:52am UTC](https://boards.straightdope.com/t/command-to-create-500-files-numbered-consecutively/658273/9 "2013-05-14T01:52:01Z")

</div>

> [@gotpasswords](#):
>
> 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.

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.
