Linux 可以写这样一个脚本,首先列出文件,从列出的结果中排除要移动的部分,然后移动剩余的部分 #!/bin/bash mkdir dir a=`ls | grep -v shell.sh | grep -v dir` mv $a dir