![]() This should work on Ubuntu, Suse, Redhat, or pretty much any version of linux. RT3070Guest Account Features: Upload 50 Files At a Time (500mb max), Mp3 and Mp4 Files Only, Max 500 Files Per Person, Direct Download Urls Last 30 days. Variation 2 - delete all files older than 30. In case if there are no files, I should log an error saying no files to delete. I know I can list all files with ls in a the folder containing the files. Hi All, I am using below code to delete files older than 2 days. I'm new to bash, I have a task to delete all files older than 30 days, I can figure this out based on the files name YMD.ext 20190430.txt. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.įind /path/to/files* -mtime 5 -exec rm \ at the end is required to end the command. Variation 1 - find all files older than 30 days that end with. Delete all files older than 30 days, based on file name as date. in with lines it it, like: Batch file to delete files older than N days. ![]() ![]() The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. Use the following command to delete last character of each line in Bash: rev. GoAnywhere MFT : Knowledge Center : Q: How can I delete files in a directory that are older than X days A: Directories can occasionally get crowded by old. ![]()
0 Comments
Leave a Reply. |