Skip to content

grahamlyons/delete-old-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Delete old files

Very simple Python script to search a directory and delete all but the newest files.

Takes a quoted path and an optional number of files to delete.

Usage:

delete_files '/path/to/files/pre_*.ext' <num_to_keep default=3>

e.g. delete_files '/home/boggins/pictures/*.jpg' 5

To show help:

delete_files -h

Releases

No releases published

Packages

No packages published

Languages