Useful linux commands
More like a reminder. I’m gonna try to add new commands to avoid every time I forget some, the need to search for them endlessly.
To search some binary or hex pattern inside a file:
grep -obarUP "<hex-pattern>" /location
Example:
grep -obarUP "\x6F\x62\x73\x63" .
To delete some bytes from a file, or in the case, the exact amount of bits from those hex patterns you just found:
dd if=test1.obs bs=1 skip=8 of=test2.obs
But I want to pipe out the grep’s output to other commands. Ok, change a few things and we are ready to go:
grep -rlP "\x6F\x62\x73\x63" | xargs -I '{}' echo '/{}'
Filed under: Uncategorized - @ 2024-03-13 13:17