Files
general-scripts-and-system-…/customscripts/find_bytes
T

13 lines
358 B
Bash

#!/bin/bash
if [ -z "$1" -o -z "$2" ]; then
echo -e "usage:\n\tfind_bytes <bytes regex> <path> \n\t\tex. find_bytes '[\x{20}]' /path/to/dir"
exit
else
# ugrep
# -W hexdump binary matches, while keeping text matches as text
# -z decompress files if need be to scan them
# -R recursive
# ug -W -z -R <bytes regex> <path>
ug -W -z -R "'$1'" "'$2'"
fi