As part of my security job, I analyze dozens of Google Chrome history files each day using sqlite3 over SSH.
There are a few dozen authorized "safe" sites each user is allowed to navigate to. For my purposes, I don't care about these safe sites. To list the URLs of each history file and ignore the safe websites, I use grep -v
and list each safe site as follows:
sqlite3 /home/me/HistoryDatabaseFile.db "select * from urls order by url;" | grep -v safesite1.com | grep -v safesite2.com | grep -v safesite3.com | grep -v safesite4.com
and on and on. My command has grown to at least 20 lines and is becoming unmanageable. Is there any way I could show the user's list of URLs while excluding my safe sites in a listed format? I'm imagining something like:
safesite1.com
safesite2.com
safesite3.com
and then bringing that list into the command. It can be internal or external- I don't really care as long as it ends up outputting in bash.
Thanks for any help you can give me!