WebApr 30, 2024 · linux - Deleting files older than 30 days based on filename as date - Unix & Linux Stack Exchange Deleting files older than 30 days based on filename as date Ask Question Asked 3 years, 11 months ago Modified 2 years, 2 months ago Viewed 6k times 5 If I have a folder of files with their filenames as the date they were created: WebApr 7, 2015 · You just have to provide the parent directory rather than the prefix of files. In your example, it would be: find /path/to -type f -mtime +5 -exec rm {} \; This will delete all the files older than 5 days which are under /path/to and its sub-directories. To delete empty sub-directories, refer to @Costas comment above. Share Improve this answer
8 Simple Ways to Securely Delete Files in Linux
WebDec 11, 2015 · How to compress and move log older than 30 days from one folder to another: LittleMaster: Linux - Newbie: 6: 09-20-2012 12:30 AM [SOLVED] Attempting to delete files that are older than 90 days, but not directories: caiphn: Linux - Newbie: 12: 07-07-2012 07:11 PM: Need to move folders older than 5 days to a bad up directory: … WebSep 7, 2024 · The below command will delete all files older than 30 days in system /user/home/ directory but before deleting the file make sure that you are deleting the … barbapul
Delete Files Older Than X Days/Hours in Bash …
WebJul 24, 2008 · delete files and folders older than 3 days find /basedirectory -type f -mtime +3 >> /tmp/tempfile find /basedirectory -type d -mtime +3 >> /tmp/tempfile mailx -s "List of removed files and folders" [email protected] < /tmp/te mpfile rm /tmp/tempfile find /basedirectory -type f -mtime +3 -exec rm {} \; find /basedirectory -type d... 8. WebOct 5, 2024 · You can also delete your files by using the Task Scheduler. Here are the steps you need to follow: Type Task Scheduler in the Start menu search bar and select … Web3. Use the Task Scheduler. 4. Use the System Settings. Delete Any File on Your Windows Device, Hassle-Free. 1. Use File Explorer. There’s no denying that File Explorer is one … barbapapà rai yoyo