如何在linux中的一列中写一堆数字?

How to write a bunch of numbers in a column in linux?

当我在 Linux (echo {1..100} 1.txt) 中使用此代码时,它会在 1、2、3 等行中写入 1 到 100 的数字,... 100. 我需要的是像下面这样垂直书写这些数字的代码。

1
2
3
4
.
.
100

您可以使用 tr 将空格转换为换行符:

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