編寫個shell腳本將當前目錄下大於10K的文件轉移到/tmp目錄下

[root@localhost ~]# vi 10K.sh

#!/bin/bash
#ext-1
#Using for move currently directory to /tmp
for Filename in $(ls -l |awk '$5 > 10240 {print $9}')
do
mv $Filename /tmp
done
ls -la /tmp
echo "Done!"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章