Tag Archives: bash

grep IP subnet


starting with 192.x.x.x
cat ip_list.txt | grep -E "(192)(\.[0-9]{1,3}){3}"

starting with 192.168.x.x
cat ip_list.txt | grep -E "(192.168)(\.[0-9]{1,3}){2}"

starting with 192.168.10.x
cat ip_list.txt | grep -E "(192.168.10.)[0-9]{1,3}"

linux add hostname to stdout

base64 /dev/urandom | head -c 1000 | sed "1 i\\`hostname`" | head -n 5

localhost.localdomain
brXE3yBW/afyXoZXigNc+bTaw71rW7Ykz9xFD01ZeXeglA/vubg9eJPmldDN3qQEOZongJbjSIEl
D6tu8lfhoYboc8eJTPPPasoQP1RcbdX/kVRbrxV2cLTaKVik2o3sywpjLZl+0Dow/9Of8iToahOw
JdWXPrkmsZZ9le4uN+qGU55Z2TO2Mc/baY0UUmBXaWX9NsNTsO4HwfqnT62Gs0BVtbMaWw0vWf3n
4QxJGcNl/gi5WUM/aamcUFe5exb8YlEk6Nj3szqf3b4DQE4XODe46W/4qCzg/UFzCb5SOC0YBnEa