编写了一个遍历一个目录下所有的文件及文件夹,然后计算每个文件的字符和line的小程序,先把程序贴出来. #coding=utf-8 ''' Created on 2014年7月14日 @author: Administrator ''' import os import os.path rootdir =r'c:\python27\jiaoben' filefullnames=[] def traverse(rootdir,filefullnames): for parent,dirnames,…
脚本内容如下: #!/bin/bash function delete_file { days=$[$-] for i in `find $dir -type f -ctime +$days` do rm -rf $i done } while read line do dir=`echo $line |awk '{print $1}'` days=`echo $line |awk '{print $2}'` delete_file $dir $days done < file.txt 其中,函…
位于/var/log目录下的20个Linux日志文件[译] from:http://buptguo.com/2014/01/16/linux-var-log-files/ 原文地址:20 Linux Log Files that are Located under /var/log Directory 如果你多数时间都在使用Linux系统,那么你有必要知道系统的日志文件位于哪里,以及每个日志文件是关于哪些内容的.在系统正常的时候学习理解各种日志文件的内容,有助于在遇到紧急情况时通过日志文件定位问…