shell
leeyan85
这个作者很懒,什么都没留下…
展开
-
linux shell判断条件和系统变量
条件判断 -b file 若文件存在且是一个块特殊文件,则为真 -c file 若文件存在且是一个字符特殊文件,则为真 -d file 若文件存在且是一个目录,则为真 -e file 若文件存在,则为真 -f file 若文件存在且是一个规则文件,则为真 -g file转载 2012-05-23 14:43:04 · 1585 阅读 · 0 评论 -
find 和xargs 结合使用修改文件名,和exec做备份
find ./ -name "*.sh" | sed 's:\([^/]*\)\(\.sh\):\1\2 \/webapp\/shell\/\1\.bak:g' | xargs -n 2 cp find ./ -name "*.sh" -exec mv {} {}.bak \;原创 2012-05-22 18:01:10 · 2060 阅读 · 0 评论