大家知道在Linux下,我们在进行排序时可以用sort -n
来按照key的数值进行排序而不是字符串值排序,那么在Windows下面有类似sort -n
的指令吗,只知道Windows下的sort /r
等同于Linux的sort -r
.
ringa_lee2017-04-17 13:53:56
Although it seems that my answer is too late, I still give you a similar method that you may have found.
You can use the sort-Object command in powershell to achieve this purpose.
λ type a.txt
1
10
2
3
5
8
90
11
After using type a.txt | sort-object -property {$_ -as [int]}:
λ type a.txt | sort-object -property {$_ -as [int]}
1
2
3
5
8
10
11
90