Delete Old Files Automatically
Chester Wyke February 28, 2025 Updated: April 26, 2025 #Debian
Debian (Series)
MAC Address Change
Set permissions recursively on directory structure
Touch (Set file modified date)
Android Apps on Linux
Blacklist Module
Calender Notifications Popup Disable
CUPS PDF Printer
gping
Hide Mounts
Nautilus
Power
Smartgit
Video Cards
Snapcraft
Acrobat Reader
Audio
Shortcuts (Important)
DNS
Mounting Drives
Setup Network Shares
Cron
Startup
Users and Groups
Paths to remember
Manually Removing Old Kernels
Set Icon for Application
Strange Problems and Fixes
Redirecting stderr
Extensions
Ubuntu Software
Show Seconds on Clock Display
Create Bootable Flash Drive
Compressed Files
services systemd (unit)
SCP
SSH
Updating
Useful commands
Firewall
View Whitespace
OpenVPN
PPP logs
MAN
Terminal
sed
Characters
zsh
Links between files
7z encrypted file
Wayland or x11?
Delete Old Files Automatically
MAC Address Change
Set permissions recursively on directory structure
Touch (Set file modified date)
Android Apps on Linux
Blacklist Module
Calender Notifications Popup Disable
CUPS PDF Printer
gping
Hide Mounts
Nautilus
Power
Smartgit
Video Cards
Snapcraft
Acrobat Reader
Audio
Shortcuts (Important)
DNS
Mounting Drives
Setup Network Shares
Cron
Startup
Users and Groups
Paths to remember
Manually Removing Old Kernels
Set Icon for Application
Strange Problems and Fixes
Redirecting stderr
Extensions
Ubuntu Software
Show Seconds on Clock Display
Create Bootable Flash Drive
Compressed Files
services systemd (unit)
SCP
SSH
Updating
Useful commands
Firewall
View Whitespace
OpenVPN
PPP logs
MAN
Terminal
sed
Characters
zsh
Links between files
7z encrypted file
Wayland or x11?
Delete Old Files Automatically
Explanation
Source: https://stackoverflow.com/questions/45838304/bash-delete-files-older-than-3-months
Before you actually run the delete command it might be good to use -print
as below to see what will be deleted.
In both commands (the print and delete one):
PATH
should be replaced with the path to the folder you want to do the deletes in.DAYS
should be replaced with the number of days you need.
See also cron for automating the command
Preview output via print
Actual delete command