如何在不知道文件扩展名的情况下递归地获取文件夹中所有归档文件的列表?
发布于 2015-06-21 12:49:51
可以使用以下命令检查没有扩展名的归档/文件的文件类型:
% file tar-latest
tar-latest: XZ compressed data
或者另一个例子:
% file foo
foo: Zip archive data, at least v2.0 to extract
列出所有档案
find . -type f -exec file {} \; | awk '/compressed|archive/'
示例
% find . -type f -exec file {} \; | awk '/compressed|archive/'
./tar-latest: XZ compressed data
./foo: Zip archive data, at least v2.0 to extract
https://askubuntu.com/questions/639131
复制相似问题