bash scripting question

Hal Duston hald at sound.net
Thu Feb 13 19:19:26 CST 2003


On Thu, 13 Feb 2003, Eric R. wrote:
> Afternoon LugNuts,
> 
> Ok, I have a group of directories named "save(and the date) i.e. 
> "save021303".
> 
> Iv'e discoverd I can make the current days directory using:
> 
> mkdir save`date +%D | cut -c 1,2,4,5,7,8`
> 
> My question is, how would I delete the directory that is several days 
> old?  i.e. save021003
> 
> rm -rf ??
> 

mkdir save`date +%m%d%y`

rm -rf save`date +%m%d%y -d '3 days ago'`

Note: The -d option is specific to GNU date.

Hal




More information about the Kclug mailing list