#!/usr/bin/perl -w use strict; my @ltrs = ('a' .. 'z', ' '); open my $fh, '>', '.bash_history' or die $!; my $lines = shift || 100000; my $max_command_length = 100; print "creating dummy .bash_history...\n"; for my $i (1 .. $lines){ my $len = int rand( $max_command_length ); my @str; for (1 .. $len){ my $c = int rand( $#ltrs + 1 ); push @str, $ltrs[ $c ]; } print $fh join('', @str), "\n"; print "lines $i\r"; } print "\ndone.\n";