如何从目录中递归查找所有文件扩展名? [英] How to find all file extensions recursively from a directory?

查看:22
本文介绍了如何从目录中递归查找所有文件扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用什么命令或命令集合来返回目录(包括子目录)中的所有文件扩展名?

What command, or collection of commands, can I use to return all file extensions in a directory (including sub-directories)?

现在,我正在使用 lsgrep 的不同组合,但我找不到任何可扩展的解决方案.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆