linux – 如何使用bash对文件夹中的文件进行排序?

我将这些文件放在一个文件夹中:

chap11-solutions.pdf
chap12-solutions.pdf
chap13-solutions.pdf
chap14-solutions.pdf
chap15-solutions.pdf
chap16-solutions.pdf
chap17-solutions.pdf
chap21-solutions.pdf
chap22-solutions.pdf
chap23-solutions.pdf
chap24-solutions.pdf
chap25-solutions.pdf
chap26-solutions.pdf
chap2-solutions.pdf
chap3-solutions.pdf
chap4-solutions.pdf
chap5-solutions.pdf
chap6-solutions.pdf
chap7-solutions.pdf
chap8-solutions.pdf
chap9-solutions.pdf

我如何以这种方式对它们进行排序:chap1 …,chap … 2,….,chap11 …,chap12,…使用Ubuntu bash shell?谢谢.

最佳答案
ls|sort -V

-V参数确保chap10被认为是chap9的上限.

相关文章

文章浏览阅读1.8k次,点赞63次,收藏54次。Linux下的目录权限...
文章浏览阅读1.6k次,点赞44次,收藏38次。关于Qt的安装、Wi...
本文介绍了使用shell脚本编写一个 Hello
文章浏览阅读1.5k次,点赞37次,收藏43次。【Linux】初识Lin...
文章浏览阅读3k次,点赞34次,收藏156次。Linux超详细笔记,...
文章浏览阅读6.8k次,点赞109次,收藏114次。【Linux】 Open...