Quote:
Originally Posted by JSLayton
Is there a way for me to write a script that will automatically delete the oldest file in a directory? Thanks in advance.
|
how do you tell the oldest file in directory?? is it by comparing it to others or how??
if you are comparing the first file with second file so in a simple way the bash script should be look like this
Code:
#
!/bin/bash
if test file1 -ot file2
then
rm file1
fi