如何找到在目录中的所有文件的扩展名? [英] How to find all file extensions in directory?
本文介绍了如何找到在目录中的所有文件的扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么命令,或集合的命令,我可以用它来返回目录(包括子目录)所有文件扩展名?
What command, or collection of commands, can I use to return all file extensions in a directory (including sub-directories)?
现在,我使用 LS
和的grep
的不同组合,但我不能找到任何可扩展的解决方案。
Right now, I'm using different combinations of ls
and grep
, but I can't find any scalable solution.
推荐答案
这个怎么样:
find . -type f -name '*.*' | sed 's|.*\.||' | sort -u
这篇关于如何找到在目录中的所有文件的扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文