filelist=`ls /root/user/` for file in $filelist do echo $file done filelist=后边的那个引号不是单引号,而是tab键上边的那个键。