refine list all files script
a better way to replace <ESC>