Linux 删除大文件下面的文件的终极处理办法
有时候一个文件下面的文件过多,rm 无力了,网上找了一圈都没有答案,于是灵机一动就了下面这几行代码。
如果要运行下面这行代码,你需要会点 Java,至少会 javac,java
import java.io.File;
public class Clean {
public static void main(String[] args) {
if(args.length>0){
File[] files = new File(args[0]).listFiles();
for(File file:files){
System.out.println(file);
file.delete();
}
}
}
}
Reproduced please indicate the author and the source, and error a link to this page.
text link:
//xiaochun.zrlog.com/linux-delete-big-dir.html