将当前目录下大于 10K 的文件转移到其他目录

#/bin/bash   
#Programm :   
# Using for move currently directory to /tmp   
#编写shell 脚本将当前目录下大于 10K 的文件转移到/tmp目录下   
for FileName in `ls -l |awk '$5>10240 {print $9}'`   
do   
mv $FileName /tmp   
done   
ls -al /tmp   
echo "Done! "

#!/bin/sh
cd ~/test
for i in `ls -l |awk '{if($5>10240) {print $9}}'`
do
mv $i /tmp
don

你可能感兴趣的:(shell)