找到资料:How to Delete Files Older than 30 days in Linux 稍作修改,得到命令 find folderName -type f -mtime +30 -delete 循环文件夹执行此操作 查询关键词:linux loop command 找到资料:How to make a for loop in command line? 得到命令: for dir in yourSumFolder/*; do (find "$dir" -type ...
[y/N] "responseresponse=${response,,}# tolowerif[[$response=~ ^(yes|y)$]];thenrm -rf$recycle_bin_dir/*echo"The contents of the recycle bin have been deleted."elseecho"The contents of the recycle bin have not been deleted."fiexit0fi# Delete files older than 30 days in the recyc...
This will move all the .jpg files older than 30 days into a new directory. bash delete file script Now we can combine these two commands to archive the images older than 15 days and delete them from the archive folder if they are older then 30 days. We are going to create a shell s...
as you are well aware. Though it's no longer necessary, some individuals save the record for future reference. You're trying todelete files older than 7 days or 30 days on Linuxor update them, and there are a lot of files to choose from when you look at the file. This post will b...
linux delete files older than 3 days down vote This is easy enough (although note that this goes by a modification time more than 3 days ago since a creation time is only available on certain filesystems with special tools): find /a/b/c/1 /a/b/c/2 -typef -mtime +3#-delete...
The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We'll use this in order to figure out what files are older than a certain number of days, and then usethe rm commandto delete them. ...
This article explains how to delete files older or newer than N days, with extra examples like matching only files using a particular extension, and more. For this we'll use find, a command line tool to search for files in a directory.
2) Bash Script to Delete a Files Older Than “X” Days in Linux We have a folder named“/var/log/apache/”that contains 15 days of logs and we are going to delete 10 days old files. The articles below are related to this topic, so you may be interested to read. ...
The /etc/tmpreaper.conf is self explanatory, and easy to understand. By default it will delete files that are 7 days old in /tmp expect some file types. If you plan to use this, then remove the ‘SHOWWARNING=true’ line from the /etc/tmpreaper.conf. ...
ext2 is used fs-options parameters for the real filesystem builder <device> path to the device to be used <size> number of blocks to be used on the device -V, --verbose explain what is being done; specifying -V more than once will cause a dry-run -h, --help display this help ...