
I matched the data in directories r09 r10 by the following command:
find r[0-9]* -name '\*-ch24-\*' | sed -e 's|r[0-9]*/n_ch24/||' > sim_sets1.txt but got confused, why it's not find r[0-9]\* -name '.\*-ch24-.\*?
*-ch24-* is a glob. -name matches globs. For a glob, * matches zero or more of any character.
.*-ch24-.* is a regular expression. If you want to match on regular expressions, use -regex instead of -name. In a regex, . matches any character and * is a quantifier which means zero or more of the preceding character.
* as \* inside a single- or double-quoted string will cause it to be treated as a literal by find, so it's implausible that find r[0-9]\* -name '\*-ch24-\*' worked as intended.perl -pe 's|r[0-9]*/n_ch24/||'