« Back to Index

[Bash remove whitelist]

View original Gist on GitHub

Tags: #bash #remove #whitelist

Bash remove whitelist.sh

# 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