How to delete files from a specific date in linux

Asked

Viewed 675 times

1

Inside a folder I have files from 2006 until 2018

and want to delete only the files of the year 2017

how to do this on linux?

  • https://unix.stackexchange.com/questions/302011/finding-and-deleting-files-with-a-specific-date

  • You can try as follows: find . -ctime -365 | xargs rm Explaining the above command, find is to search for files and directories in Linux. indicates the directory you are in (don’t do this within a directory you don’t want to delete the files) -ctime searches for files by the date of creation, -365 indicates the time you are looking for, | xargs this command picks up the output of the find command and applies the other action requested in case rm.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.