Windows (PowerShell) Get-ChildItem -Recurse -Filter "*.py" | Where-Object { $_.FullName -match '\\migrations\\' -and $_.Name -ne '__init__.py' } | Remove-Item Get-ChildItem -Recurse -Filter "*.pyc" | Where-Object { $_.FullName -match '\\migrations\\' } | Remove-Item Mac | Linux find . -path "*/migrations/*.py" -not -name "__init__.py" -delete find . -path "*/migrations/*.pyc" -delete