如何从一个项目中删除所有pyc文件? [英] How do I remove all .pyc files from a project?

查看:441
本文介绍了如何从一个项目中删除所有pyc文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经改名为某些文件在一个相当大的项目,并希望删除他们留下的pyc文件。我试过bash脚本:

  RM -r * .pyc文件

但我认为这将不通过文件夹递归。我在做什么错了?


解决方案

 找到。 -name* .pyc文件-exec RM -rf {} \\;

在评论中提到,你也可以使用 -delete 操作

 找到。 -name \\ *。PYC -delete

I've renamed some files in a fairly large project and want to remove the .pyc files they've left behind. I tried the bash script:

 rm -r *.pyc

But that doesn't recurse through the folders as I thought it would. What am I doing wrong?

解决方案

find . -name "*.pyc" -exec rm -rf {} \;

as mentioned in the comments, you can also use the -delete action

find . -name \*.pyc -delete

这篇关于如何从一个项目中删除所有pyc文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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