Hi,
I have a directory which contains files.This Directory keeps getting in new files from time to time.I want to maintain only 15 files in that directory at any time and the old files should be deleted.
Eg:
Directory 'c' @'a/b/c contains:
1_a
2_a
3_a...
I want to delete all the old files and maintain only 15 such files.Please note the title of the files is in this format "1_a"...
I know I have to use the command :
find /a/b/c -type f -name '*.a' -mtime +10 -exec rm {} \;
I just want toincorporate that 15 files limit in that directory.
Thanks.