Looking Out for Potholes
Monday, July 30, 2012
Bash: Delete oldest 5 files in a directory
After a bit of searching, I found quite a few options. This was simple and got the job done.
find /directoryName -type f | awk 'NR>5'|xargs rm -f
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)