1,用root修改rm的权限:
#chmod o-x /bin/rm
2,在用户主目录下创建个"垃圾箱"
$mkdir ~/.temp
:
代码:
cat erase
#!/bin/ksh
(($#==0)) && { echo "No paraments!";exit 1; }
for i in $*
do
mv -f $i ~/.temp/$(find $(pwd) -maxdepth 1 -name $i|tr "/" "=")
done
文件脚本:
代码:
cat unerase
#!/bin/ksh
(($#==0))&&{ echo "No paraments!";exit 1; }
cd ~/.temp
list=$(for i in $*;do ls ~/.temp|grep "\<$i\>";done)
for j in $list
do
file=$(echo $j|tr "=" "/")
mv $j ${file%/*}/${file##*/}
done
阅读(1210) | 评论(0) | 转发(0) |