Creating trash data?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating trash data?
# 1  
Old 11-09-2010
Creating trash data?

How could I go about creating some trash files to use for testing. All I need is for files to exist and the data in them really doesn't matter.

I need to do some work and testing with scripts and I don't want to mess with real data in my testing.

So I would like to generate say 10,000 files in a directory.
# 2  
Old 11-09-2010
10,000 files containing what? nothing? garbage? random binary garbage? garbage text? You could tail 1000 lines from a system log and copy it. Or if empty will do, you can just do touch dir/to/file{0..9999}
# 3  
Old 11-09-2010
Contents of the files do not matter, they can be empty. I just need a bunch of files.
# 4  
Old 11-09-2010
Code:
for N in {00..99}
do
        touch ${N}{00..99}
done

should generate empty files in the current directory from 0000 to 9999.
# 5  
Old 11-09-2010
Only seems to create one file not 10000 files.

I'm using Bash with Free BSD.
# 6  
Old 11-09-2010
Well, what file does it create? My crystal ball's still in for maintenance.

Here, in BASH, I can do:

Code:
$ for N in {1..5} ; do touch ${N}{1..5} ; done
$ ls
11  13  15  22  24  31  33  35  42  44  51  53  55
12  14  21  23  25  32  34  41  43  45  52  54
$

...which is just a reduced version of the script I gave you, creating 25 files of [1-5][1-5] instead of 0000-9999.
# 7  
Old 11-09-2010
all I get is one file.

0B Nov 9 11:58 {1..5}{1..5}

Don't buy crystal balls from walmart those things are not reliable. You gotta get it from costco. Smilie

---------- Post updated at 03:01 PM ---------- Previous update was at 02:59 PM ----------

Think I got it to work using this.

Code:
for (( i=0 ; i < 1000 ; i++ )) ; do touch $i ; done

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Creating data delimited by ASCII code 1

<Any suggestion how to create a file where the values are separated by ASCII code 1,with data extracted from a table using shell script The format is :/> <columnname1(binary1)columnvalue(binary1)columnname2(binary1)columnvalue(binary1)columnname3(binary1)columnvalue... 1st row/>... (6 Replies)
Discussion started by: dasun
6 Replies

2. Shell Programming and Scripting

Creating a matrix out of a longitudinal data set

Hi I do have a tab delimited file with 2 columns, which is stratified based on the first column. There are 1000's of values in the file. Below is an example of the input file 1 AB 1 AC 1 CC 1 DD 2 AB 2 CC 2 AC 2 AB 3 CF 3 CC 3 DD 4 AC 4 CC 4 AD (5 Replies)
Discussion started by: Kanja
5 Replies

3. Shell Programming and Scripting

Creating Multiple data files with spaces in the filename

Hi, I have a list of filenames in the format with Spaces in the filename. As an example : Sample File 1.txt Sample File 2.txt Sample File 3.txt.....I have about 100 files like this. I am trying to create a block of code or use an available command to a) Create a file b) Put in some... (2 Replies)
Discussion started by: ban3rj33
2 Replies

4. Shell Programming and Scripting

Creating html table from data in file

Hi. I need to create html table from file which contains data. No awk please :) In example, ->cat file num1 num2 num3 23 3 5 2 3 4 (between numbers and words single TAB). after running mycode i need to get (heading is the first line): <table>... (2 Replies)
Discussion started by: Manu1234567
2 Replies

5. Shell Programming and Scripting

Creating loops inside a file and extracting and loading data

Help needed (1 Reply)
Discussion started by: Chand Shrestha
1 Replies

6. UNIX for Dummies Questions & Answers

creating a new variable from existing data

Hello, I have the following data set: TRAIT DOSE 40 0.4 30 0.3 95 1.2 120 1.7 85 1.4 136 1.8 134 1.8 40 0.4 30 0.3 95 1.2 120 1.7 85 1.4 136 1.8 134 1.8 40 0.4 30 0.3 95 1.2 (2 Replies)
Discussion started by: wolf_blue
2 Replies

7. UNIX for Advanced & Expert Users

creating data loading script

asdfasdfasdfasdf??? (2 Replies)
Discussion started by: noorm
2 Replies

8. UNIX for Advanced & Expert Users

Creating data of size

Hello, I need to create 100kb,1000kb,10000kb etc files of no particular substance but I need them a exact size. I think they are .dat's I need but im unsure of the command I issue to create them Any help appreciated :) Mr Pink (4 Replies)
Discussion started by: Mr Pink
4 Replies
Login or Register to Ask a Question