WebApr 30, 2024 · Here is another solution to delete log files older than 30 days: #!/bin/sh # A table that contains the path of directories to clean rep_log=("/etc/var/log" "/test/nginx/log") echo "Cleaning logs - $(date)." 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 prior to the current date. Then to remove the files: find /path-to-directory -mtime +5 -exec rm -f {} \; This will remove all those files previously listed. Alter the ...
Delete/move/copy files of specific date - linuxquestions.org
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 … WebOct 5, 2024 · Type CMD in File Explorer’s address bar and press Enter. This should open a Command Prompt window. Select the folder path displayed and press Ctrl + C to copy it. In this example, the folder path is C:\Users\tladi\Downloads. You now have your folder path. So, you can now decide on the files you want to delete. cloud computing examples in business
How to delete all files before a certain date in Linux
WebSep 10, 2014 · 243 means 01 jan 14 to 31 Aug 14. and 1 sep to 10 sep (10 days) The files before 01 jan 14 will not be listed. first list the files . verify the files then run the rm command. to list the files. Code: find . -type f -mtime +10 -mtime -253 … WebJul 4, 2024 · Registered User. 270, 99. Hi, In theory, this should be fairly straightforward. If you want to delete all files created from 2024 and beyond (i.e. also files from 2016, 2015, etc - anything older than 2024), then you could do something like this: Code: find /path/to/files -type f -mtime +549 -exec rm -fv \ {\} \; 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. cloud computing examples website