The lazy programmer scripts
scripts that work

Lazy alias to clean Python pyc's. GitHub

Bash and PowerShell aliases which recursively clean all .pyc files from a Python project for decluttering.

# Bash:
alias clean-pycs='find . | grep -E -e ".+\.py[cod]" -e ".+/__pycache__" | xargs rm -rf'

# PowerShell:
Set-Alias -Name Clean-Pycs -Value "Get-ChildItem -Path .\ -Recurse -Include *.pyc -Include *__pycache__ | foreach ($_) { Remove-Item $_.FullName }"

That's all, folks!

Written by nasolie on Tuesday September 15, 2015
Permalink - Tags: powershell, bash, windows, python, python3

Leave a comment

comments powered by Disqus

« Lazy set MTU on Linux - Lazy basic use of git »