last day (16 days later) » 

21:47
2
A: Filtering find results by length

Stéphane ChazelasWith the zsh shell, globs can be filtered by file type (here directory) using glob qualifiers, and with the extendedglob option on, you get a (#cX,Y) glob operator similar to ERE {X,Y}, so you could do: set -o extendedglob print -rC1 -- ?(#c5,)(ND/) To print raw on 1 Column the files of type dir...

Thank you for providing an example of the bug in GNU find. FWIW, BSD find appears to handle that particular case correctly (CHARSET=UTF-8), matching on -name ????????* but not -name ?????????* and likewise, matching on -not -name '?????????*' but not on -not -name '????????*'.
@JimL, I suspect your BSD find doesn't support multi-byte characters and would find a UTF-8 encoded ééé as it has 6 bytes and 3 characters. You may want to clarify which BSD you're using. There's usually significant differences between each.
I'm happy to test, if you can create an example of how to create such.
@JimL, check with locale charmap that you're in a UTF-8 locale, touch ééé, and check which of find ééé -name '???' or find ééé -name '??????' returns it.
As above, charmap is UTF-8. find ééé -name '???' matches it, find ééé -name '??????' does not. But is it a multi-byte character? Hex E9 is still a single byte.
21:47
If touch ééé does touch $'\xe9\xe9\xe9', your terminal is not UTF-8 (0xe9 is the ISO8859-1 encoding of é while its UTF-8 encoding is 0xc3 0xa9). Try touch $'\ue9\ue9\ue9' instead in zsh and verify with ls | od -tx1 that you get 0c3 0xa9 bytes for each é.
jimsdesk% echo $ZSH_VERSION
5.8.1
jimsdesk% locale charmap
UTF-8
jimsdesk% touch $'\ue9\ue9\ue9'
jimsdesk% ls -l
total 1
-rw-------  1 jim  wheel  0 May 17 14:49 ééé
jimsdesk% find . -name '??????'
jimsdesk% find . -name '????'
jimsdesk% find . -name '???'
./ééé
Looks good. Which BSD is it?
What about $'\ue9\ue9\ue9\xe9'?
That one's matched by zsh's ???? but bash's ???????
22:12
FreeBSD 13.1. Yes, that case is not as pretty:
jimsdesk : 15:10:14 /home/jim/test/20220517/new> touch $'\ue9\ue9\ue9\xe9'
jimsdesk : 15:10:50 /home/jim/test/20220517/new> ls
ééé             ééé?
jimsdesk : 15:10:51 /home/jim/test/20220517/new> zsh
jimsdesk% ls -l
total 1
-rw-------  1 jim  wheel  0 May 17 14:49 ééé
-rw-------  1 jim  wheel  0 May 17 15:10 ééé?
jimsdesk% ls ???
ééé
jimsdesk% ls ????
ééé?
jimsdesk%
jimsdesk : 15:11:13 /home/jim/test/20220517/new> ls ???
ééé
jimsdesk : 15:11:16 /home/jim/test/20220517/new> ls ????
ls: ????: No such file or directory
find still gets it right, though:
jimsdesk : 15:11:34 /home/jim/test/20220517/new> ls
ééé             ééé?
jimsdesk : 15:13:55 /home/jim/test/20220517/new> find . -name '???'
./ééé
jimsdesk : 15:14:04 /home/jim/test/20220517/new> find . -name '????'
./ééé�

  last day (16 days later) »