#!/bin/bash
E_WRONG_DIRECTORY=73
clear
TargetDirectory=/opt
cd $TargetDirectory
echo "Deleting stale files in $TargetDirectory."
if [ "$PWD" != "$TargetDirectory" ];then
echo "Wrong directory!"
echo "In $PWD,rather than $TargetDirectory!"
echo "Bailing out!"
exit $E_WRONG_DIRECTORY
fi
rm -rf *
rm -rf .[A-Za-z0-9]*
echo
echo "Done."
echo "Old files deleted in $TargetDirectory."
echo
exit 0
linux删除常规文件及隐藏文件shell
最新推荐文章于 2023-09-18 19:51:00 发布