View original Gist on GitHub
Tags: #bash #remove #whitelist
# Remove files that DON'T match those listed... rm -r $(ls | egrep -v 'Makefile|Pipfile|lambda_function.py') # For example ^^ all files would be deleted except: # # Makefile # Pipfile # lambda_function.py