'4800483343' is a directory, and 'file1' & 'file2' are two files in it.Why is the following happening?$ ls 4800483343file1 file2$ md5sum 4800483343/*36468e77d55ee160477dc9772a99be4b  4800483343/file129b098f7d374d080eb006140fb01bbfe  4800483343/file2$ mv 4800483343 4800[48]3343$ md5sum 4800[48]3343/*md5sum: 4800[48]3343/*: No such file or directory$ md5sum '4800[48]3343'/*36468e77d55ee160477dc9772a99be4b  4800[48]3343/file129b098f7d374d080eb006140fb01bbfe  4800[48]3343/file2What other characters cause this?
Why are square brackets preventing shell expansion?
shell;quoting;filenames;wildcards
Answer for original questionWhy are square brackets preventing shell expansionSquare brackets do not prevent shell expansion but quotes do.I suspect that the commands that you actually ran were as followsThis runs md5sum on the files in dir/:$ md5sum d[i]r/*02fdd7309cef4d392383569bffabf24c  dir/file1db69ce7c59b11f752c33d70813ab5df6  dir/file2This moves dir to d[i]r with the quotes preventing the expansion of the square brackets:$ mv dir 'd[i]r'This looks for directory dir which no longer exists:$ md5sum d[i]r/*d[i]r/*: No such file or directoryBecause of the quotes, the following looks in the new directory named d[i]r:$ md5sum 'd[i]r'/*02fdd7309cef4d392383569bffabf24c  d[i]r/file1db69ce7c59b11f752c33d70813ab5df6  d[i]r/file2Answer for revised questionIn the revised question, the directory 4800483343 exists and the following command run:mv 4800483343 4800[48]3343What happens when this command is run depends on whether the glob 4800[48]3343 matches any existing directory.  If no directory matches that, then 4800[48]3343 expands to itself 4800[48]3343 and the directory 4800483343 is moved to the directory 4800[48]3343.Consequently:The command md5sum 4800[48]3343/*  will return the error No such file or directory because no directory exists which matches the glob 4800[48]3343.The command md5sum '4800[48]3343'/* will correctly find the files because the quotes prevent expansion of the glob.Examples of globsLet's create two files:$ touch a1b a2bNow, observe these globs:$ echo a[123]ba1b a2b$ echo a?ba1b a2b$ echo *ba1b a2b