Category: BASH scripts

Find text string in file

I save a script named “findtext” that will look inside any file smaller than my maximum (avoiding searching huge binary file) #!/bin/bash maxFileSize=10M #don’t search inside huge binary files if [ $# -eq 1 ]; then srchText=$1 fDir=”.” fntmp=”*” elif [ $# -eq 2 ]; then fDir=$1 srchText=$2 fntmp=”*” elif [ $# -eq 3 ]; […]

Checking your Public IP address (Linux/Mac)

The script below allows you to check your public IP. This is handy when say you work on a VPN and want to quickly check that you’re still connected (by seeing that your IP is in your organizations VPN IP address range), or like many folks behind a NAT router. Note, use this script responsibly, […]