Quick reference
Four blocks, twenty commands, one receipt.
Discover
rg -n 'email|phone' --glob '*.json'
psql -c '\d+ customers'
find . -name '*.csv' -size +1M
aws s3 ls s3://exports --recursive
sqlite3 app.db '.schema users'Scan
rg -c '@[a-z0-9.-]+' exports/
csvcut -n exports/customers.csv
head -1 exports/*.csv | sort -u
jq -r '.. | .email? // empty' dump.json
rg -l 'passport|iban|ssn' --type jsonDelete
shred -u -z exports/customers.csv
find /exports -mtime +90 -delete
drop table events_2023_01;
aws s3 rm s3://exports/2023/ --recursive
redis-cli del session:aliceVerify
psql -c 'select count(*) from customers'
aws s3 ls s3://exports/2023/
rg -c 'email' /var/log/app/*.log
sha256sum exports/customers.csv
aws cloudtrail lookup-events --max-items 5In one line: Discovery without deletion is just inventory. A deletion you cannot prove is a promise.
Prove it is gone:
aws s3 ls s3://exports/2023/Explained
Start with discovery. Search the repository for field names and patterns, list the columns in the busiest tables, find the large CSV files nobody remembers exporting, list the object store prefixes, and read the schema of the local database. Each command answers a small question; together they sketch the map.
Then scan the exports. Count matches for an email pattern, list the columns in a CSV, compare headers across files, pull nested values out of JSON, and search for identifiers such as passport or IBAN. This is where pattern matching earns its keep, and where it stops: a name in a support note is invisible to a regex.
Then delete and verify. Shred a file, drop a partition, remove an object prefix, confirm the prefix is empty, and pull the audit events that prove the job ran. Keep the receipt with the job.
The honest caveat: every delete command here is irreversible, and a wildcard in the wrong directory removes the wrong data. Run it against a copy first, with a name that cannot match production.
Your turn: Which command would prove your last deletion actually happened?
Related on this site
More notes: Privacy & data protection
- P1160Five questions before you share a dataset
- P1159Access logs that survive an audit
- P1158Encryption layers: at rest, in transit, in use
- P1157Four privacy numbers worth writing down
- P1156Retention that deletes itself
- P1155Answering a data subject request
- P1154Five places PII hides in plain sight
- P1153Classifying data without a committee
Open in the notes app: search, filters, copy This note on GitHub