Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想根据名称以递增的方式对文件夹中包含的子文件夹列表进行排序:
例如:文件夹名称:
TF_list_to_test10679 TF_list_to_test1062 TF_list_to_test1078 ...
期望的输出:
TF_list_to_test1062 TF_list_to_test1078 TF_list_to_test10679 ...
如何做到这一点?
如果您没有带制表符的文件名,则以下内容应该有效:
find . -type d | sed 's/[[:digit:]]*$/&\t&/' | sort -nk 2 | cut -f 1