1、目录下文件
# ls -l release.100.csvrelease.101.csvrelease.102.csvrelease.103.csvrelease.104.csvrelease.105.csvrelease.106.csvrelease.107.csvrelease.108.csvrelease.109.csvrelease.110.csvrelease.86.csvrelease.87.csvrelease.88.csvrelease.89.csvrelease.90.csvrelease.96.csvrelease.97.csvrelease.98.csvrelease.99.csv
2、重新排列
ls * | sort -n -t . -k 2
解释:
-n 按照数字排排序
-r 反向
-t 分割(文件名)
-k 2 第k(2)位置的数据排列
ls * | sort -n -t . -k 2release.86.csvrelease.87.csvrelease.88.csvrelease.89.csvrelease.90.csvrelease.96.csvrelease.97.csvrelease.98.csvrelease.99.csvrelease.100.csvrelease.101.csvrelease.102.csvrelease.103.csvrelease.104.csvrelease.105.csvrelease.106.csvrelease.107.csvrelease.108.csvrelease.109.csvrelease.110.csv