Find files by name, and move

 A="a.txt b.txt"
echo ""
echo "loop string"
for j in $A;
do
    
    for i in `find . -maxdepth 1 -iname $j`; 
    do
    
        echo $i
        mv $i newfolder/$i
    done
done

Use .sh file can be run, ignore file name case

This method also can ignore file name case, look for whether a file exists

Guess you like

Origin www.cnblogs.com/javac/p/11755475.html