Recursively Deleting Files with a Specific Extension on Linux

Recursively Deleting Files with a Specific Extension on Linux

find ./ -type f -name "*.vtt" -delete        

find: Find command locates all the folders and files on the system or inside the directory specified.

./ is the directory it needs to look into to search for the specific files.

-type f : By passing f option for type, we specify that we are looking for files and not directories.

-name: -name option is used to provide the name of the file to look for, we use the wildcard option with the .vtt extension. It will recursively look for .vtt files inside the ./ directory.

-delete: -delete is the operation to be performed on the located files.

Andrii Lytvyn

Business development | Entrepreneurship | Product development

9 个月

Nasyx, thanks for sharing!

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了