加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-13 19:32:21 所属栏目:Linux 来源:网络整理
导读:我将这些文件放在一个文件夹中: chap11-solutions.pdfchap12-solutions.pdfchap13-solutions.pdfchap14-solutions.pdfchap15-solutions.pdfchap16-solutions.pdfchap17-solutions.pdfchap21-solutions.pdfchap22-solutions.pdfchap23-solutions.pdfchap24-s

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

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的上限.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读