can someone provide a command to delete files by year? I have several files created last year 2009.
Im trying to list first ls -lrt | grep '/2009/ {print $10}' by it returns no result.
Pls advise
can someone provide a command to delete files by year? I have several files created last year 2009.
Im trying to list first ls -lrt | grep '/2009/ {print $10}' by it returns no result.
Pls advise
How does your ls -lrt looks like...
ls -lrt | awk '$8 ~ /2009/{print $9}'
Create 2 files with timestamps for 2008-12-31 and 2009-12-31, and then use man find (POSIX)'s -newer option, eg:
touch -t 200812312359.59 oldest
touch -t 200912312359.59 newest
find / -type f -newer oldest \! -newer newest -print