小编R. *_*red的帖子

如何删除没有特定扩展名的文件?

如何在当前工作目录中递归删除所有不带.txt.exe扩展名的文件?我需要一线。

我试过了:

find . ! -name "*.txt" "*.exe" -exec rm -r {} \
find -type f -regextype posix-extended -iregex '.*\.(txt|exe)$'
Run Code Online (Sandbox Code Playgroud)

linux shell

2
推荐指数
1
解决办法
1591
查看次数

标签 统计

linux ×1

shell ×1