1、不想说了、有机会在写
#!/bin/bash cd /opt/my/myfile/myfilemv for name in `ls` do if [ -d $name ] then echo $name >> /opt/my/dname mv /opt/my/myfile/myfilemv/$name/*.mp4 /opt/new/key_$name.mp4 2>>/opt/my/errormp.log mv /opt/my/myfile/myfilemv/$name /opt/my/myfile/myfile01 elif [[ ${name:0:4} != "key_" ]] then echo $name >> /opt/my/jiakey mv /opt/my/myfile/myfilemv/$name /opt/new/key_$name elif [[ ${name:0:4} == "key_" ]] then echo $name >> /opt/my/meidong.log mv /opt/my/myfile/myfilemv/$name /opt/new/$name else echo $name >> /opt/my/weizhi1 mv /opt/my/myfile/myfilemv/$name /opt/weizhi/ fi done