查找N天前的文件
查找N天前的文件find directory -mtime +N查找N天前的文件并删除它们find directory -mtime +N -exec rm {} ;[@more@]
unix里按日期格式命名文件
#date '+%Y%m%d' | awk '{ print $1 }'20061019#date '+%Y%m%d' | awk '{ print $1-1 }'20061018...........................................bash-2.03# more main.sh#!/bin/shdt=`date '+%Y%m%d' | awk '{ print $1-1 }'`mv billing_detail.xls billing_detail_${dt}.xls[@more@]
tar gzip on the fly(extension)
to unpack on the fly... gunzip < FILE.tar.gz | tar xvf - to pack on the fly... tar cvf - FILE-LIST | gzip -c > FILE.tar.gz[@more@]