delete all files but do not delete any directory
来源:互联网 发布:什么软件打字最快 编辑:程序博客网 时间:2024/05/22 12:03
#!/bin/bash
myfunc()
{
for x in $(ls)
do
if [ -f "$x" ];then
echo "$x is file";
rm -rf "$x";
elif [ -L "$x" ];then
echo "this is a link";
else
echo "$x is directory";
cd "$x";
myfunc;
cd ..
fi
done
}
cd /home/www/mall/templates
myfunc
myfunc()
{
for x in $(ls)
do
if [ -f "$x" ];then
echo "$x is file";
rm -rf "$x";
elif [ -L "$x" ];then
echo "this is a link";
else
echo "$x is directory";
cd "$x";
myfunc;
cd ..
fi
done
}
cd /home/www/mall/templates
myfunc
- delete all files but do not delete any directory
- delete all the cvs files on XP
- delete files
- KnFTP Server Directory Traversal delete any file Vulnerability
- java read delete files
- Delete untracked files
- Removing obsolete files from server... Could not delete
- QObject: Do not delete object, 'unnamed', during its event handler!
- Error “Cannot Delete folder: The directory is not empty” Fix
- VC++ Delete Directory
- all-delete-orphan
- Delete ALL CVS dir
- all-delete-orphan
- delete all tagname
- rman: delete [all] input
- delete all input
- Hibernate all-delete-orphan
- all-delete-orphan
- DLL 中 .DEF文件的使用
- 实现文本的追加
- c++通过存储过程访问数据库库(ado)
- 将方法绑定到委托
- 电子表单系列谈之电子表单基础概念
- delete all files but do not delete any directory
- 安装PowerDesigner12后,word鼠标老是不能用
- fstream的简单使用
- 编写服务程序步骤
- 我的IT这几年(外一)
- Win2k3访问共享文件夹问题解决
- 三万元装修90平方米 只有想不到没有做不到(图)
- code complete33章读书笔记
- 我的IT这几年(外二)