Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line?
something like
magic_command start 100 lines 5 > b.txt
and then, b.txt would be
100
101
102
103
104
|
Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line? something like
and then,
|
||||
|
|
There is already a command for this:
will print these numbers on separate lines: 100 101 102 103 104 So just direct this output into a file:
and seq 100 2 104 will print in increments of two, namely: 100, 102, 104 |
|||||||
|
|
Linux ships with the
or in ksh/bash/zsh
or in zsh
|
|||||||||||
|
|
perl:
bc:
dc:
|
|||||||
|
|
If you don't mind a space in front of most of them:
Without the space but with an extra command:
Edit for a bonus vim command (open vim):
For more numbers, increase |
|||||
|