Some folders on macOS have custom icons that are stored in a file named Icon?
, where the ?
is actually a CR
character, and only prints as "?" in most cases (in Terminal and Finder).
But when printing such a file name in hex in Terminal, you'll get:
$ ls -l1 Icon* | xxd
00000000: 4963 6f6e 0d0a Icon..
The 0d
is the CR
at the end of the name, and the 0a
is the LF that's printed by ls
at the end of each line.
Now, I like to find such files, using find
.
I'd think that this would be the way:
find -E . -iregex ".*/Icon\x0d"
Nor does:
find -E . -iregex ".*/Icon\r"
However, this won't find it. But this finds it (using .
as a wildcard char):
find -E . -iregex ".*/Icon."
But something is wrong with looking for hex chars in general, because this doesn't work either:
find -E . -iregex ".*/\x49con."
\x49
is the code for I
, so this should work.
So, if you want to try this yourself, take any file and try to find it using the find
command with the -regex option and specifying at least one character in hex, e.g. looking for the file named "a" with the regex \x61
or whatever is correct. Can you accomplish it?