我有一个简单的问题。
当我有一个数字列表并使用排序时,我得到以下结果:
10
11
12
7
8
9
因为1
低于7
,所以排序10
低于7
。我怎样才能让它正确排序,10
而不是使用1
,然后使用0
。我需要得到以下结果:
7
8
9
10
11
12
谢谢!
编辑:执行时echo -e "18\n19\n8\n9" | sort -n
,我得到了正确的输出:
8
9
18
19
但是在 find 命令(find /home/cas/plex-media/series/ -type f -name "*" ! -name "*.srt" | sort -n
)之后进行管道传输时,我没有得到正确的输出:
/home/cas/plex-media/series/Pokémon/Season 18/Pokémon - S18E40 - Balloons, Brionne, and Belligerence!.mp4
/home/cas/plex-media/series/Pokémon/Season 18/Pokémon - S18E41 - Mounting an Electrifying Charge!.mp4
/home/cas/plex-media/series/Pokémon/Season 18/Pokémon - S18E42 - Alola, Kanto!.mp4
/home/cas/plex-media/series/Pokémon/Season 18/Pokémon - S18E43 - When Regions Collide!.mp4
/home/cas/plex-media/series/Pokémon/Season 1/Pokémon - S01E01 - Pokémon - I Choose You!.mp4
/home/cas/plex-media/series/Pokémon/Season 1/Pokémon - S01E02 - Pokémon Emergency.mp4
/home/cas/plex-media/series/Pokémon/Season 1/Pokémon - S01E03 - Ash Catches a Pokémon.mp4
/home/cas/plex-media/series/Pokémon/Season 1/Pokémon - S01E04 - Challenge of the Samurai.mp4