LINUX & 技术 17 Apr 2007 11:48 am

linux 批量删除文件

find ../shanghai/ -name “*.html” -exec rm -f {} \;
在命令行可执行在shell里报错
find: missing argument to `-exec’
换用
find ../shanghai/ -name “*.html”|xargs rm -rf
在命令行可执行在shell里报错
rm:无效选项 —
请尝试执行‘rm –help’来获取更多信息。

给shell加上#!/bin/bash
报错
: bad interpreter: 没有那个文件或目录sh

由于shell是在windows下写的,估计是换行的问题.
系统没装dos2unix,所以在linux下重写一遍,成功。

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply