WebAug 5, 2010 · Processing a log file based on date/time input and the date/time on the log file Hi, I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. WebNov 20, 2007 · Rep: Using the find command and command pipes you can search out the files you like and then send them to the correct command. Code: find -mtime 2. This would find all files modified 2*24h=48h ago. This result can be piped to the rm command like this. Code: find -mtime 2 xargs rm.
shell - Remove all files created before a certain date - Unix & Linux ...
WebJun 17, 2005 · Can't find the syntax to delete files by date so any help would be appreciated. Cheers 06-17-2005, 01:44 AM #2: jschiwal. LQ Guru ... Listing Files based on date: axero: Linux - Newbie: 2: 10-19-2003 04:58 PM: LinuxQuestions.org > Forums > Linux Forums > Linux - General. All times are GMT -5. WebApr 30, 2024 · First to see the files modified or created based on a certain date: find /path-to-directory -mtime +5 -exec ls -l {} \; This will list all the files created or modified 5 days … brick nj reservoir
How To Delete Files By Date In Linux? – Systran Box
WebNov 21, 2009 · log files named with a timestamp. log folder specified. find looks for *.txt files only in the log folder. type f ensures you only deletes files. maxdepth 1 ensures you dont enter subfolders. log files older than 7 days are deleted ( assuming this is for a backup log) notes the start / end time. WebOct 9, 2024 · Is there is any solution to delete the files based on comparing their modified date with the most recently modified file? The older files need to be deleted with respect to most recent file. For example, if the last modified date is 09-10-2024, it means the files that are 10 days older need to be deleted. WebAug 24, 2014 · I noticed today (after ~8 years of happily hacking away at bash) that there is no trivial way to 'delete by date' using ´rm'. The solution is therefore to pipe stuff around a … tarilu jumble