shell编程题(十三)

题目:

编写个shell脚本将当前目录下大于10K的文件转移到/tmp目录下。

答案:

#!/bin/bash

for FileName in `ls -l | awk '$5>10240 {print $9}'`; do
    mv $FileName /tmp
done

ls -al /tmp
原文地址:https://www.cnblogs.com/wanghao-boke/p/12152199.html