Home > Net >  How to write a bunch of numbers in a column in linux?
How to write a bunch of numbers in a column in linux?

Time:04-25

When I use this code in Linux (echo {1..100} 1.txt), it writes numbers of 1 to 100 in rows like 1, 2, 3, ... 100. Something I need is a code to write these numbers vertically like below.

1
2
3
4
.
.
100

CodePudding user response:

You could use tr to convert spaces to linebreaks:

echo {1..100} | tr ' ' '\n'
  • Related