Date: 2018.8.15
1、参考:

http://bbs.chinaunix.net/thread-2012638-1-1.html

2、linux中find命令的排序规则

find命令的搜寻条件直接关系到输出结果,默认应该是按从左到右的的顺序判断,如果有逻辑运算(-not、-and、-or)还得再判断条件组合。
find查询的结果是找到一个匹配的项就立即输出结果,一边查找一边输出,查找到的内容不是一次性输出的,所以可能没有统一排序。
但是具体排序规则需要分析find命令的底层实现了。

3、linux shell编程中文件查找并排序的方法

方法一:

find  dir  -name "*.txt"  | sort

方法二:

ls  $(find dir -name "*.txt")

相关文章:

  • 2021-04-21
  • 2021-06-08
  • 2021-12-18
  • 2021-08-19
  • 2021-10-14
  • 2021-12-06
  • 2021-06-17
  • 2022-01-22
猜你喜欢
  • 2021-12-23
  • 2021-06-12
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-01-11
相关资源
相似解决方案